UNPKG

@pai-tech/pai-os

Version:
35 lines (23 loc) 844 B
/** * @file PAI-OS wrapper module. * @author <a href="mailto:ron@pai-tech.org">Ron Fridman</a> * @copyright PAI-TECH Artificial Intelligenec 2018 */ const { PAICodeCommand, PAICodeCommandContext, PAICodeModule, PAICode } = require('@pai-tech/pai-code'); const { PAI_OS, OS_Utils } = require('./index'); async function start(){ let paiOS = new PAI_OS(); let path = await paiOS.getOSPath(); await PAICode.loadModule('pai-os',paiOS); let context = new PAICodeCommandContext('host','HardCoded'); let response = await PAICode.executeString(`pai-os run command:'ls'`,context); response = await PAICode.executeString(`pai-os system-info`,context); let toPrint = JSON.stringify(response[0].response.data); console.log(toPrint); } start().then().catch(e => { console.log(e) });