mirror of
https://github.com/bvanroll/rpiRadio.git
synced 2025-08-31 04:52:56 +00:00
Initial Commit
This commit is contained in:
32
ProjectNow/NodeServer/node_modules/node-cmd/cmd.js
generated
vendored
Normal file
32
ProjectNow/NodeServer/node_modules/node-cmd/cmd.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
var commandline={
|
||||
get:getString,
|
||||
run:runCommand
|
||||
};
|
||||
|
||||
function runCommand(command){
|
||||
//return refrence to the child process
|
||||
return exec(
|
||||
command
|
||||
);
|
||||
}
|
||||
|
||||
function getString(command,callback){
|
||||
//return refrence to the child process
|
||||
return exec(
|
||||
command,
|
||||
(
|
||||
function(){
|
||||
return function(err,data,stderr){
|
||||
if(!callback)
|
||||
return;
|
||||
|
||||
callback(err, data, stderr);
|
||||
}
|
||||
}
|
||||
)(callback)
|
||||
);
|
||||
}
|
||||
|
||||
module.exports=commandline;
|
Reference in New Issue
Block a user