Namespace: Process

Process

Process file description
Source:

Example

in file : myproc.process.js
var proc =
{
  "state": true,
  "pos": 100,
  "restart": 'none', // auto or none
  "attempt": 5, // 0 = infinte
  "delay": 3000, // ms
  "started": 10000, // delay before first start
  "wait": false, // true or false, if true delay by "delay" ms
  "type": "cmd", // cmd || file
  "cmd":"ps", // command to launch if type == cmd
  "file": "file.js", // js file to launch
  "args": [], // args of command to launch. If type == file, args[0] is replaced by file
  "options": {}, // command options
  "mode": "exec", // exec mode : exec || cron || mixed. Default is exec
  "onOut": function(data){}, // called on process output
  "onError": function(data){}, // called on process error
  "onClose": function(){}, // called when process is closed
  "cron" : { 'day':'*', date:'*', 'month':'*', 'hour':'0', 'minute':'0' } // cron options if mode == cron || mixed, every day at 00h00 by default

};
module.exports = proc;