1.0.1 • Published 10 years ago

exec-spawn v1.0.1

Weekly downloads
31
License
MIT
Repository
github
Last release
10 years ago

exec-spawn

wrapper of spawn that can be used as exec.

Install

npm install exec-spawn

Usage

var exec = require('exec-spawn');

exec('echo', ['test'], function(err, stdout, stderr) {
  console.dir(stdout.toString()); // 'test\n'
});
var exec = require('exec-spawn');

var cmd = 'git';
var argument = ['log', '-n 1', '--oneline'];
var options =  {
  cwd: '../exec-spawn',
  env: process.env
};

exec(cmd, argument, options, function(err, stdout, stderr) {
  console.dir(stdout.toString()); // '9b1de95 Initial commit\n'
});