{"_id":"@cf-vendored/forever-monitor","_rev":"2-df68c7bae739df86169aa4d793c46d6c","name":"@cf-vendored/forever-monitor","dist-tags":{"latest":"1.7.21"},"versions":{"1.7.2":{"name":"@cf-vendored/forever-monitor","description":"Core forever process monitor","version":"1.7.2","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"contributors":[{"name":"Charlie Robbins","email":"charlie@nodejitsu.com"},{"name":"Fedor Indutny","email":"fedor.indutny@gmail.com"},{"name":"James Halliday","email":"mail@substack.net"},{"name":"Bradley Meck","email":"bradley@nodejitsu.com"},{"name":"Dominic Tarr","email":"dominic@nodejitsu.com"},{"name":"Maciej Małecki","email":"maciej@nodejitsu.com"}],"repository":{"type":"git","url":"git+ssh://git@github.com/codefresh-io/cf-forever.git"},"keywords":["fault tolerant","sysadmin","tools"],"dependencies":{"broadway":"~0.3.6","chokidar":"^3.3.1","minimatch":"~3.0.2","ps-tree":"0.0.x","utile":"^0.3.0"},"devDependencies":{"optimist":"~0.6.1","vows":"~0.7.0"},"main":"./lib/index.js","scripts":{"test":"vows test/**/*-test.js --spec -i","test:ci":"npm run test"},"license":"MIT","engines":{"node":">= 0.8.x"},"gitHead":"a396a5222835340f00117c2939a0f49d607325f5","bugs":{"url":"https://github.com/codefresh-io/cf-forever/issues"},"homepage":"https://github.com/codefresh-io/cf-forever#readme","_id":"@cf-vendored/forever-monitor@1.7.2","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"alex-codefresh","email":"a.cheshko@codefresh.io"},"dist":{"integrity":"sha512-fZgVmbMvUaY/hv8E0fw6XZIjc4Lnqx4khTHS7MzhGm8OYVydCtXlSjV+uPWyIDtyVUjeLwGwH2KPkxKAmMTXDw==","shasum":"4921486add2a6a31498e57af22ea7d1baab552c4","tarball":"https://registry.npmjs.org/@cf-vendored/forever-monitor/-/forever-monitor-1.7.2.tgz","fileCount":48,"unpackedSize":58685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+Jj/CRA9TVsSAnZWagAAzaQQAJsp63ddUJy4QqoutPZ1\nOpP9zZEJTETF8RXgBclgROi4uf1VVIaCuKiIb39UUTmYYnuGZBZwhoYMXONL\nw2vmJa6QJZ/OIJ9LEy5g1T5GJtginN6RI1zGNiCJcNekPokoQHIykZxvEtS3\n1MfAMJt5M9xdsY5CdHyo5eQyDuCY2704TotnKA5tfp8Ry5sy0T+dzjgVadbM\nCdMeJDWlsRPy5m5pz77RZ+wfl0K8wn8vWnGXg4JNc8E5nLtna4eaCBOMFv2R\nPZhd1cgd9r9g5y6s3hhAN8ZTwS1KysXb/v0d14BMLBvAIdHBVQfFo3qqjHeA\ns0XQtshFr0dyjP3pFlCaq6NhMoGDW3hImh7UjnsII24ghtu8GxTcyB5cuiWx\nwIXQ0yDRwfvqO5vPeMUjNrPJ14PigWO+8dczaqi78viIH4rZoSUmPnyflkV1\nYUBRE5BLk6OvsM6iFKKP3fpleam5aX+5czHlFCqpqoe6EnilRvRzo1V6yYRn\nmGNOe255wP+lIONeKtFVjnh792XXQp5H8C/cCO8T45/iciM5AaQqgtcE1shu\nVHrMsE+LtMuiLWKQIkSNCLzukLgfoMCm9gRjwE+kbHjlcSJpIYvXTGzEuEgp\nfI3vcahOlJkgZvXIveTZ/tROQ+O4dRWQ5reCpMVv4Sr5ma8vKCOw1/Mq7cV3\n9nqq\r\n=eRtx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKNm5A0YaPIZ/cBGqCH/lr5c9GfSuB9h3q+8/lsHcCsAiEA2biEedt0lcH1ep/1HBy1iPOXq05hat11c0Sd+6790fI="}]},"maintainers":[{"name":"alex-codefresh","email":"a.cheshko@codefresh.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/forever-monitor_1.7.2_1576573183261_0.3185426628804895"},"_hasShrinkwrap":false},"1.7.21":{"name":"@cf-vendored/forever-monitor","description":"Core forever process monitor","version":"1.7.21","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"http://github.com/codefresh-io/cf-forever/forever-monitor"},"dependencies":{"broadway":"~0.3.6","chokidar":"^3.3.1","minimatch":"~3.0.2","ps-tree":"0.0.x","utile":"^0.3.0"},"devDependencies":{"optimist":"~0.6.1","vows":"~0.7.0"},"main":"./lib/index.js","scripts":{"test":"vows test/**/*-test.js --spec -i","test:ci":"npm run test"},"license":"MIT","engines":{"node":">= 0.8.x"},"gitHead":"a396a5222835340f00117c2939a0f49d607325f5","_id":"@cf-vendored/forever-monitor@1.7.21","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"alex-codefresh","email":"a.cheshko@codefresh.io"},"dist":{"integrity":"sha512-7pKuHMqO9W3B2Y5VQzp70IIqYEq3UEAiVosn7d98Tm/09uzWt7gKsgGs99sTRzFUZ8/6COzDBakxb5pxBivADA==","shasum":"1ef1c483c78ab4b7d7e258bd1730dac101341705","tarball":"https://registry.npmjs.org/@cf-vendored/forever-monitor/-/forever-monitor-1.7.21.tgz","fileCount":48,"unpackedSize":58131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+Jz5CRA9TVsSAnZWagAAXSIQAIc/M2wemwAEikL4RMIU\nZKQg5W4eGFPeEh2214lblecBzhP2LITxj9evu/vYLJDfSbDksQrc6GxW0B7r\nfCjPk95/xsVJJYwPm5A5qK79DkpeJRtcz8d1z3At3jRlsXj1Jq5CWCKngdWZ\nbULKhqSM/+3GpiU88b2GvgwEnn7z9+NvocXFR6fXewfzaCEtfSLaFB9g2bJD\nEUQ6Iq1Ipr4Z0Ess8l6o75JgzGem1Q0iYTc2eDkyM2FORgRjU965TAUWhxxD\noiIqPtfXeKMfUzGo/N9+1Bt84SNz4mpDVLp+g6cZw73+CmgbiWeoNzUzaDx8\ncAaEqsHA2AbYoudm8h0G30FzkJ+m4FS4UQQN1w442J3vfnQG7FP1n2fRWKZ7\nllzWfJanJBAnML4ZOyZbmKGTO+LTUADCq2Dwbkz/OWCHuM2h2J9lp1ijqFUv\nK10p95WO6e5IudIgS5H8eTGKPY+vTPighSvKf2o40d5YcGf04URwLi3uM3Wv\n7DrjCf7nNxOLMkb+kaXTB1z6y6cZcTpfv13y4eMbVKt6zUmSRAWCPQ3wPZS8\nE3xoR2XWJS6sBcLxflxhm68k6r5VksqvC8fsuJTEX+MQz1JZ2/VsQrQBnK0D\nPfjHcjX4okLdHd06V+lO4PWjZj9xGbIJib5d2HVUdocin9J8S8a1gkdlncOT\nlthA\r\n=rdio\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCui+GXsiyTS46oFwWYb8+fIpcj+8sxMXXUwNGNfdcwugIhAJuRck5BYEK15gmjKUz69djGUk565DVx7lOp/+Lyof9V"}]},"maintainers":[{"name":"alex-codefresh","email":"a.cheshko@codefresh.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/forever-monitor_1.7.21_1576574200997_0.6934814230432267"},"_hasShrinkwrap":false}},"time":{"created":"2019-12-17T08:59:43.028Z","1.7.2":"2019-12-17T08:59:43.393Z","modified":"2022-04-04T22:23:26.441Z","1.7.21":"2019-12-17T09:16:41.196Z"},"maintainers":[{"name":"alex-codefresh","email":"a.cheshko@codefresh.io"}],"description":"Core forever process monitor","repository":{"type":"git","url":"http://github.com/codefresh-io/cf-forever/forever-monitor"},"author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"license":"MIT","readme":"# forever-monitor [![Build Status](https://secure.travis-ci.org/foreverjs/forever-monitor.png)](http://travis-ci.org/foreverjs/forever-monitor)\n\nThe core monitoring functionality of forever without the CLI\n\n## Usage\nYou can also use forever from inside your own node.js code.\n\n``` js\n  var forever = require('@cf-vendored/forever-monitor');\n\n  var child = new (forever.Monitor)('your-filename.js', {\n    max: 3,\n    silent: true,\n    args: []\n  });\n\n  child.on('exit', function () {\n    console.log('your-filename.js has exited after 3 restarts');\n  });\n\n  child.start();\n```\n\n### Spawning a non-node process\nYou can spawn non-node processes too. Either set the `command` key in the\n`options` hash or pass in an `Array` in place of the `file` argument like this:\n\n``` js\n  var forever = require('@cf-vendored/forever-monitor');\n  var child = forever.start([ 'perl', '-le', 'print \"moo\"' ], {\n    max : 1,\n    silent : true\n  });\n```\n\n### Options available when using Forever in node.js\nThere are several options that you should be aware of when using forever. Most of this configuration is optional.\n\n``` js\n  {\n    //\n    // Basic configuration options\n    //\n    'silent': false,            // Silences the output from stdout and stderr in the parent process\n    'uid': 'your-UID',          // Custom uid for this forever process. (default: autogen)\n    'pidFile': 'path/to/a.pid', // Path to put pid information for the process(es) started\n    'max': 10,                  // Sets the maximum number of times a given script should run\n    'killTree': true,           // Kills the entire child process tree on `exit`\n\n    //\n    // These options control how quickly forever restarts a child process\n    // as well as when to kill a \"spinning\" process\n    //\n    'minUptime': 2000,     // Minimum time a child process has to be up. Forever will 'exit' otherwise.\n    'spinSleepTime': 1000, // Interval between restarts if a child is spinning (i.e. alive < minUptime).\n\n    //\n    // Command to spawn as well as options and other vars\n    // (env, cwd, etc) to pass along\n    //\n    'command': 'perl',         // Binary to run (default: 'node')\n    'args':    ['foo','bar'],  // Additional arguments to pass to the script,\n    'sourceDir': 'script/path',// Directory that the source script is in\n\n    //\n    // Options for restarting on watched files.\n    //\n    'watch': true,               // Value indicating if we should watch files.\n    'watchIgnoreDotFiles': null, // Whether to ignore file starting with a '.'\n    'watchIgnorePatterns': null, // Ignore patterns to use when watching files.\n    'watchDirectory': null,      // Top-level directory to watch from. You can provide multiple watchDirectory options to watch multiple directories (e.g. for cli: forever start -w='app' -w='some_other_directory' app\\index.js)\n\n    //\n    // All or nothing options passed along to `child_process.spawn`.\n    //\n    'spawnWith': {\n      customFds: [-1, -1, -1], // that forever spawns.\n      setsid: false,\n      uid: 0, // Custom UID\n      gid: 0  // Custom GID\n    },\n\n    //\n    // More specific options to pass along to `child_process.spawn` which\n    // will override anything passed to the `spawnWith` option\n    //\n    'env': { 'ADDITIONAL': 'CHILD ENV VARS' },\n    'cwd': '/path/to/child/working/directory',\n\n    //\n    // Log files and associated logging options for this instance\n    //\n    'logFile': 'path/to/file', // Path to log output from forever process (when daemonized)\n    'outFile': 'path/to/file', // Path to log output from child stdout\n    'errFile': 'path/to/file', // Path to log output from child stderr\n\n    //\n    // ### function parseCommand (command, args)\n    // #### @command {String} Command string to parse\n    // #### @args    {Array}  Additional default arguments\n    //\n    // Returns the `command` and the `args` parsed from\n    // any command. Use this to modify the default parsing\n    // done by 'forever-monitor' around spaces.\n    //\n    'parser': function (command, args) {\n      return {\n        command: command,\n        args:    args\n      };\n    }\n  }\n```\n\n### Events available when using an instance of Forever in node.js\nEach forever object is an instance of the node.js core EventEmitter. There are several core events that you can listen for:\n\n* **error**   _[err]:_             Raised when an error occurs\n* **start**   _[process, data]:_   Raised when the target script is first started.\n* **stop**    _[process]:_         Raised when the target script is stopped by the user\n* **restart** _[forever]:_         Raised each time the target script is restarted\n* **exit**    _[forever]:_         Raised when the target script actually exits (permanently).\n* **stdout**  _[data]:_            Raised when data is received from the child process' stdout\n* **stderr**  _[data]:_            Raised when data is received from the child process' stderr\n\n### Typical console output\n\nWhen running the forever CLI tool, it produces debug outputs about which files have changed / how processes exited / etc. To get a similar behaviour with `forever-monitor`, add the following event listeners:\n\n```js\nvar child = new (forever.Monitor)('your-filename.js');\n\nchild.on('watch:restart', function(info) {\n    console.error('Restarting script because ' + info.file + ' changed');\n});\n\nchild.on('restart', function() {\n    console.error('Forever restarting script for ' + child.times + ' time');\n});\n\nchild.on('exit:code', function(code) {\n    console.error('Forever detected script exited with code ' + code);\n});\n```\n\n## Installation\n\n``` bash\n  $ npm install forever-monitor\n```\n\n## Run Tests\n\n``` bash\n  $ npm test\n```\n\n#### License: MIT\n#### Author: [Charlie Robbins](http://github.com/indexzero)\n#### Contributors: [Fedor Indutny](http://github.com/indutny), [James Halliday](http://substack.net/), [Charlie McConnell](http://github.com/avianflu), [Maciej Malecki](http://github.com/mmalecki)\n","readmeFilename":"README.md"}