mirror of
https://github.com/bvanroll/rpiRadio.git
synced 2025-08-31 04:52:56 +00:00
Initial Commit
This commit is contained in:
28
ProjectNow/NodeServer/node_modules/node-cmd/example/basic.js
generated
vendored
Normal file
28
ProjectNow/NodeServer/node_modules/node-cmd/example/basic.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
var cmd=require('../cmd.js');
|
||||
|
||||
cmd.get(
|
||||
'pwd',
|
||||
function(data){
|
||||
console.log('the current working dir is : ',data)
|
||||
}
|
||||
);
|
||||
|
||||
cmd.run('touch example.created.file');
|
||||
|
||||
cmd.get(
|
||||
'ls',
|
||||
function(data){
|
||||
console.log('the current dir contains these files :\n\n',data)
|
||||
}
|
||||
);
|
||||
|
||||
cmd.get(
|
||||
`
|
||||
git clone https://github.com/RIAEvangelist/node-cmd.git
|
||||
cd node-cmd
|
||||
ls
|
||||
`,
|
||||
function(data){
|
||||
console.log('the node-cmd clone dir contains these files :\n\n',data)
|
||||
}
|
||||
);
|
0
ProjectNow/NodeServer/node_modules/node-cmd/example/example.created.file
generated
vendored
Normal file
0
ProjectNow/NodeServer/node_modules/node-cmd/example/example.created.file
generated
vendored
Normal file
4
ProjectNow/NodeServer/node_modules/node-cmd/example/getPID.js
generated
vendored
Normal file
4
ProjectNow/NodeServer/node_modules/node-cmd/example/getPID.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var cmd=require('../cmd.js');
|
||||
|
||||
var processRef=cmd.get('node');
|
||||
console.log(processRef.pid);
|
27
ProjectNow/NodeServer/node_modules/node-cmd/example/nodePythonTerminal.js
generated
vendored
Normal file
27
ProjectNow/NodeServer/node_modules/node-cmd/example/nodePythonTerminal.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
const cmd=require('../cmd.js');
|
||||
|
||||
const processRef=cmd.get('python -i');
|
||||
let data_line = '';
|
||||
|
||||
//listen to the python terminal output
|
||||
processRef.stdout.on(
|
||||
'data',
|
||||
function(data) {
|
||||
data_line += data;
|
||||
if (data_line[data_line.length-1] == '\n') {
|
||||
console.log(data_line);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const pythonTerminalInput=`primes = [2, 3, 5, 7]
|
||||
for prime in primes:
|
||||
print(prime)
|
||||
|
||||
`;
|
||||
|
||||
//show what we are doing
|
||||
console.log(`>>>${pythonTerminalInput}`);
|
||||
|
||||
//send it to the open python terminal
|
||||
processRef.stdin.write(pythonTerminalInput);
|
Reference in New Issue
Block a user