{"_id":"process-finder","_rev":"287437","name":"process-finder","description":"Find processes using a simple API","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"time":{"modified":"2021-06-03T18:40:28.000Z","created":"2013-06-26T19:47:18.808Z","1.0.0":"2014-09-16T08:50:05.789Z","0.1.3":"2014-05-13T00:00:07.078Z","0.1.2":"2014-05-12T23:57:02.969Z","0.1.1":"2014-05-12T23:55:40.367Z","0.1.0":"2014-05-12T23:54:05.096Z","0.0.7":"2013-07-15T16:44:54.001Z","0.0.6":"2013-07-15T16:33:55.121Z","0.0.5":"2013-07-15T15:29:18.165Z","0.0.4":"2013-07-15T14:46:54.243Z","0.0.3":"2013-07-15T14:00:18.530Z","0.0.2":"2013-07-15T12:08:11.216Z","0.0.1":"2013-06-26T19:47:18.808Z"},"users":{},"author":{"name":"Nicolas Bevacqua","email":"hello@bevacqua.io","url":"http://ponyfoo.com"},"repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"versions":{"1.0.0":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"hello@bevacqua.io","url":"http://ponyfoo.com"},"version":"1.0.0","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{"minimist":"^0.1.0"},"main":"./finder.js","bin":{"procfinder":"bin/procfinder"},"gitHead":"c7770376006e289c361ca8100c0595c5656b5d03","_id":"process-finder@1.0.0","scripts":{},"_shasum":"72700b0cc0ee7fd0cdec3b317f4583f615c8704f","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"dist":{"shasum":"72700b0cc0ee7fd0cdec3b317f4583f615c8704f","size":13813,"noattachment":false,"key":"/process-finder/-/process-finder-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-1.0.0.tgz"},"directories":{},"publish_time":1410857405789,"_cnpm_publish_time":1410857405789,"_hasShrinkwrap":false},"0.1.3":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"hello@bevacqua.io","url":"http://ponyfoo.com"},"version":"0.1.3","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{"minimist":"^0.1.0"},"main":"./finder.js","bin":{"procfinder":"bin/procfinder"},"_id":"process-finder@0.1.3","dist":{"shasum":"41d4801b02cacf614dc07e2ef4b500e18d572e2a","size":13780,"noattachment":false,"key":"/process-finder/-/process-finder-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.1.3.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1399939207078,"_cnpm_publish_time":1399939207078,"_hasShrinkwrap":false},"0.1.2":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"hello@bevacqua.io","url":"http://ponyfoo.com"},"version":"0.1.2","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{"minimist":"^0.1.0"},"main":"./finder.js","bin":{"procfinder":"bin/procfinder"},"_id":"process-finder@0.1.2","dist":{"shasum":"7db114a485218895e1d29626e8d9d30c355ea690","size":13775,"noattachment":false,"key":"/process-finder/-/process-finder-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.1.2.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1399939022969,"_cnpm_publish_time":1399939022969,"_hasShrinkwrap":false},"0.1.1":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"hello@bevacqua.io","url":"http://ponyfoo.com"},"version":"0.1.1","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{"minimist":"^0.1.0"},"main":"./finder.js","bin":{"procfinder":"bin/procfinder"},"_id":"process-finder@0.1.1","dist":{"shasum":"e8bbc114a5fbc90ddb902b3f96df7d851616a81c","size":13773,"noattachment":false,"key":"/process-finder/-/process-finder-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1399938940367,"_cnpm_publish_time":1399938940367,"_hasShrinkwrap":false},"0.1.0":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"hello@bevacqua.io","url":"http://ponyfoo.com"},"version":"0.1.0","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{},"main":"./finder.js","bin":{"procfinder":"bin/procfinder"},"_id":"process-finder@0.1.0","dist":{"shasum":"fa7c5837e909fd3eae93dfd0e83c11e4397979ad","size":13758,"noattachment":false,"key":"/process-finder/-/process-finder-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1399938845096,"_cnpm_publish_time":1399938845096,"_hasShrinkwrap":false},"0.0.7":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"nicolasbevacqua@gmail.com","url":"http://www.ponyfoo.com"},"version":"0.0.7","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{},"main":"./finder.js","engines":{"node":"0.10.6","npm":"1.2.x"},"readmeFilename":"README.md","_id":"process-finder@0.0.7","dist":{"shasum":"4c6b572915c3dcfb208356141f4e2ebb11ce0274","size":13423,"noattachment":false,"key":"/process-finder/-/process-finder-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.0.7.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1373906694001,"_cnpm_publish_time":1373906694001,"_hasShrinkwrap":false},"0.0.6":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"nicolasbevacqua@gmail.com","url":"http://www.ponyfoo.com"},"version":"0.0.6","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{},"main":"./finder.js","engines":{"node":"0.10.6","npm":"1.2.x"},"readmeFilename":"README.md","_id":"process-finder@0.0.6","dist":{"shasum":"fbea9de89b647b88dcc1368be1198e226830a0b0","size":13441,"noattachment":false,"key":"/process-finder/-/process-finder-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.0.6.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1373906035121,"_cnpm_publish_time":1373906035121,"_hasShrinkwrap":false},"0.0.5":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"nicolasbevacqua@gmail.com","url":"http://www.ponyfoo.com"},"version":"0.0.5","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{},"main":"./finder.js","engines":{"node":"0.10.6","npm":"1.2.x"},"readmeFilename":"README.md","_id":"process-finder@0.0.5","dist":{"shasum":"a7f028f0298496fd6a889dae574a9f4691642411","size":13380,"noattachment":false,"key":"/process-finder/-/process-finder-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.0.5.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1373902158165,"_cnpm_publish_time":1373902158165,"_hasShrinkwrap":false},"0.0.4":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"nicolasbevacqua@gmail.com","url":"http://www.ponyfoo.com"},"version":"0.0.4","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{},"main":"./finder.js","engines":{"node":"0.10.6","npm":"1.2.x"},"readmeFilename":"README.md","_id":"process-finder@0.0.4","dist":{"shasum":"9cc7e6a27508189a5e17dff9007cd55f3022fad9","size":13261,"noattachment":false,"key":"/process-finder/-/process-finder-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.0.4.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1373899614243,"_cnpm_publish_time":1373899614243,"_hasShrinkwrap":false},"0.0.3":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"nicolasbevacqua@gmail.com","url":"http://www.ponyfoo.com"},"version":"0.0.3","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{},"main":"./finder.js","engines":{"node":"0.10.6","npm":"1.2.x"},"readmeFilename":"README.md","_id":"process-finder@0.0.3","dist":{"shasum":"332122088acd9d610d296afc25519c9f8f56367c","size":13236,"noattachment":false,"key":"/process-finder/-/process-finder-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.0.3.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1373896818530,"_cnpm_publish_time":1373896818530,"_hasShrinkwrap":false},"0.0.2":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"nicolasbevacqua@gmail.com","url":"http://www.ponyfoo.com"},"version":"0.0.2","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{},"main":"./finder.js","engines":{"node":"0.10.6","npm":"1.2.x"},"readmeFilename":"README.md","_id":"process-finder@0.0.2","dist":{"shasum":"b20acf49b2378d7a52fc96a4f0410965dca8a390","size":13254,"noattachment":false,"key":"/process-finder/-/process-finder-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1373890091216,"_cnpm_publish_time":1373890091216,"_hasShrinkwrap":false},"0.0.1":{"name":"process-finder","description":"Find processes using a simple API","homepage":"https://github.com/bevacqua/process-finder","author":{"name":"Nicolas Bevacqua","email":"nicolasbevacqua@gmail.com","url":"http://www.ponyfoo.com"},"version":"0.0.1","repository":{"type":"git","url":"git://github.com/bevacqua/process-finder.git"},"bugs":{"url":"https://github.com/bevacqua/process-finder/issues"},"dependencies":{},"main":"./finder.js","engines":{"node":"0.10.6","npm":"1.2.x"},"readmeFilename":"README.md","_id":"process-finder@0.0.1","dist":{"shasum":"b8a7938cd8f7552735daa4f9e745fa3d6da4e895","size":13103,"noattachment":false,"key":"/process-finder/-/process-finder-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-finder/download/process-finder-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"directories":{},"publish_time":1372276038808,"_cnpm_publish_time":1372276038808,"_hasShrinkwrap":false}},"readme":"# process-finder\n\nFind processes and watch ports for listener processes using a simple API\n\n## Installation\n\nUsing `npm`\n\n```bash\n$ npm install process-finder --save\n```\n\n## #find(port, fn(err, pids, data, internal))\n\nFinds processes listening on the provided `port`, invokes `fn` with an array of `pids` listening on that port.\n\n`data` is the output of the command that checks the status of the port. `internal` will contain any internal errors that might have been suppressed.\n\n### #find Usage\n\n```js\nvar finder = require('process-finder');\nvar port = 3000;\n\nfinder.find(port, function(err, pids){\n    // do something about the pids listening on the port, i.e:\n    pids.forEach(process.kill);\n});\n```\n\nPort can be an object of `options`, or just a port.\n\n```js\n{\n    port: 3000, // the port we listen on\n    elevate: false, // whether to use `sudo`, to get elevated priviledges\n}\n```\n\n## #watch(port)\n\nReturns an `EventEmitter` that allows us to track a port's listening processes.\n\nPort can be an object of `options`, or just a port.\n\n```js\n{\n    port: 3000, // the port we listen on\n    frequency: 200, // the frequency with which the port is scanned for changes\n    elevate: false, // whether to use `sudo`, to get elevated priviledges\n    info: false // if enabled, a verbose `info` event will be emitted\n}\n```\n\n### #watch Usage\n\n```js\nvar finder = require('process-finder');\nvar port = 3000; // port to watch\nvar watcher = finder.watch(port);\n\nwatcher.on('listen', function(pid){\n    console.log(pid + ' listening on port ' + port);\n});\n\nwatcher.on('unlisten', function(pid){\n    console.log(pid + ' no longer listening on port ' + port);\n});\n\nwatcher.on('error', console.error);\nwatcher.on('update', function(pids){\n    console.log('updated! listeners:', pids);\n});\n```\n\n### #watch API\n\n#### #watch.stop()\n\nStops a `watch`. It will no longer emit events.\n\n#### #watch.start()\n\nStarts a watch which was previously stopped using `.stop()`\n\n#### #watch.restart()\n\nForce-restart the watch.\n\n### #watch events\n\nWatch extends the `EventEmitter` prototype, and provides a few events you can listen for.\n\n#### #watch.on('start', fn())\n\nTriggers when the watch is started, either when manually started, or when a new watch is created.\n\n#### #watch.on('stop', fn())\n\nTriggers when a watch is stopped.\n\n#### #watch.on('listen', fn(pid))\n\nTriggers when a `pid` is detected to be listening on the port we're watching. The `pid` is passed as an argument.\n\n#### #watch.on('unlisten', fn(pid))\n\nTriggers when a `pid` is detected to be no longer listening on the port we're watching. The `pid` is passed as an argument.\n\n#### #watch.on('update', fn(pids))\n\nTriggers every time the port is scanned for changes.\n\n#### #watch.on('info', fn(data, internal))\n\n`data` is the output of the command that checks the status of the port. `internal` will contain any internal errors that might have been suppressed.\n\n#### #watch.on('error', fn(err))\n\nTriggers whenever an error is thrown.\n\n# CLI\n\nThe CLI allows you to wait on a port\n\n```shell\nprocfinder --wait --port 3000\n```\n\nOnce a process starts listening on that port, the CLI will output its `pid` and exit.\n","_attachments":{},"homepage":"https://github.com/bevacqua/process-finder","bugs":{"url":"https://github.com/bevacqua/process-finder/issues"}}