lib/core/process.js
function Process(settings) {
    // save arguments
    this.settings = settings;

    // build args
    this.args = [settings.file].concat(settings.args || []);

    // build env
    this.env = helpers.mergeObject({}, settings.env || process.env);
    if (settings.options) {
      this.env.spawnOptions = JSON.stringify(settings.options);
    }

    // defaults properties
    this.closed = !!settings.close;
    this.suicide = false;
    this.pid = null;
    this.alive = false;

    // this streams will relay data from and to the process
    this.stderr = new streams.RelayStream({ paused: false });
    this.stdout = new streams.RelayStream({ paused: false });
    this.stdin = new streams.RelayStream({ paused: false });

    // relay io
    if (this.settings.ipc && helpers.support.pipeFork) {
      this.send = function () {
        this.process.send.apply(this.process, arguments);
      };
      this.flush = function () {};
    }
  }
function Process(settings) {
    // save arguments
    this.settings = settings;

    // build args
    this.args = [settings.file].concat(settings.args || []);

    // build env
    this.env = helpers.mergeObject({}, settings.env || process.env);
    if (settings.options) {
      this.env.spawnOptions = JSON.stringify(settings.options);
    }

    // defaults properties
    this.closed = !!settings.close;
    this.suicide = false;
    this.pid = null;
    this.alive = false;

    // this streams will relay data from and to the process
    this.stderr = new streams.RelayStream({ paused: false });
    this.stdout = new streams.RelayStream({ paused: false });
    this.stdin = new streams.RelayStream({ paused: false });

    // relay io
    if (this.settings.ipc && helpers.support.pipeFork) {
      this.send = function () {
        this.process.send.apply(this.process, arguments);
      };
      this.flush = function () {};
    }
  }
function Process ( settings ) { // save arguments this . settings = settings ; // build args this . args = [ settings . file ] . concat ( settings . args || [ ] ) ; // build env this . env = helpers . mergeObject ( { } , settings . env || process . env ) ; if ( settings . options ) { this . env . spawnOptions = JSON . stringify ( settings . options ) ; } // defaults properties this . closed = ! ! settings . close ; this . suicide = false ; this . pid = null ; this . alive = false ; // this streams will relay data from and to the process this . stderr = new streams . RelayStream ( { paused : false } ) ; this . stdout = new streams . RelayStream ( { paused : false } ) ; this . stdin = new streams . RelayStream ( { paused : false } ) ; // relay io if ( this . settings . ipc && helpers . support . pipeFork ) { this . send = function ( ) { this . process . send . apply ( this . process , arguments ) ; } ; this . flush = function ( ) { } ; } }
this constrcutor will spawn a new process using a option object
this constrcutor will spawn a new process using a option object