node-exec

Execute shell commands from NodeJS


Keywords
node-exec, nodejs, bash, shell, unix
License
LGPL-3.0
Install
npm install node-exec@0.1.1

Documentation

node-exec

Execute shell commands from NodeJS

How to use?

Simple, just install it, require it and use it

  • Install it:

npm install --save node-exec

  • Require it:
    var shell = require('node-exec');
  • Usage:
      let cmd = "pwd";
      /**
      * @params {string} cmd (required)
      */
      shell.run(cmd).then(function(res){
        // res: object with keys {code,result} or {code,error}
        console.dir(res);
      });