1.0.0 • Published 8 years ago
knode-shell v1.0.0
knode-shell
is a simple shell module wrapper for running shell commands
Install:
npm install --save knode-shell
Usage samples:
//example without args
shell.run('ls', [], function(err, out) {
if (err) {
console.log("ERROR: " + err);
}
return console.log(out);
});
//example with args
shell.run('ls', ['-la'], function(err, out) {
if (err) {
console.log("ERROR: " + err);
}
return console.log(out);
});
//example exec command
shell.exec('ls -la', null, function(err, out) {
if (err) {
console.log("ERROR: " + err);
}
return console.log(out);
});
//example exec command with pipe
shell.exec('ls -la | grep index', null, function(err, out) {
if (err) {
console.log("ERROR: " + err);
}
return console.log(out);
});
1.0.0
8 years ago