1.0.0 • Published 7 years ago

knode-shell v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

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);
});