Files
rpiRadio/ProjectNow/NodeServer/node_modules/node-cmd/commandline.js
2018-05-19 02:20:19 +02:00

28 lines
455 B
JavaScript

var exec = require('child_process').exec;
var commandline={
get:getString,
run:runCommand
};
function runCommand(command){
exec(
command
);
}
function getString(command,callback){
exec(
command,
(
function(){
return function(err,data,stderr){
callback(data,err,stderr);
}
}
)(callback)
);
}
module.exports=commandline;