node-ipc/node_modules/node-cmd/cmd.js
2014-09-02 23:25:35 -07:00

31 lines
No EOL
568 B
JavaScript

var sys = require('sys'),
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){
if(!callback)
return;
callback(data);
}
}
)(callback)
);
}
module.exports=commandline;