exec-buffer
Advanced tools
Comparing version
@@ -11,10 +11,13 @@ 'use strict'; | ||
* | ||
* @param {Object} opts | ||
* @api public | ||
*/ | ||
function ExecBuffer() { | ||
function ExecBuffer(opts) { | ||
if (!(this instanceof ExecBuffer)) { | ||
return new ExecBuffer(); | ||
return new ExecBuffer(opts); | ||
} | ||
this.opts = opts || {}; | ||
this.opts.stderr = this.opts.stderr !== false; | ||
this.src(tempfile()); | ||
@@ -95,3 +98,3 @@ this.dest(tempfile()); | ||
if (stderr) { | ||
if (this.opts.stderr && stderr) { | ||
cb(stderr); | ||
@@ -98,0 +101,0 @@ return; |
{ | ||
"name": "exec-buffer", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Run a buffer through a child process", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -35,6 +35,8 @@ # exec-buffer [](https://travis-ci.org/kevva/exec-buffer) | ||
### new ExecBuffer() | ||
### new ExecBuffer(opts) | ||
Creates a new `ExecBuffer` instance. | ||
Creates a new `ExecBuffer` instance. Available options are: | ||
* `stderr`: Whether to add `stderr` output to `err` in the callback. Defaults to `true`. | ||
### .use(bin, args) | ||
@@ -41,0 +43,0 @@ |
3931
6.56%109
2.83%84
2.44%