knode-shell

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i knode-shell

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • prokvk