{"_id":"@blinkz/portastic","_rev":"1-f3604ad43eaa96505c14c5207b589663","name":"@blinkz/portastic","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@blinkz/portastic","version":"1.0.1","description":"Pure javascript swiss knife for port management","main":"index.js","scripts":{"test":"mocha --tdd --bail test/**/*-test.js","travis":"istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec test/**/*-test.js && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage"},"repository":{"type":"git","url":"git+https://github.com/alanhoff/node-portastic.git"},"keywords":["port","management","open ports","find open","interface"],"author":{"name":"Alan Hoffmeister","email":"alanhoffmeister@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/alanhoff/node-portastic/issues"},"bin":{"portastic":"bin/portastic"},"homepage":"https://github.com/alanhoff/node-portastic#readme","dependencies":{"bluebird":"^2.9.34","commander":"^2.8.1","debug":"^2.2.0"},"devDependencies":{"chai":"^3.2.0","coveralls":"^2.11.4","istanbul":"^0.3.17","mocha":"^2.2.5"},"directories":{"lib":"lib","test":"test"},"_id":"@blinkz/portastic@1.0.1","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-aVgBf/LkKds/CiE3aV9uvutdJytimMSHZ2ymSjMJDJzQeGt13QmeoNhDhBn24YYvCba1Z0tZRA3oJXUg5NUF0Q==","shasum":"2d2edbcbca69c84a1654705f0e88818bf4f842b8","tarball":"https://registry.npmjs.org/@blinkz/portastic/-/portastic-1.0.1.tgz","fileCount":8,"unpackedSize":13484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegcVECRA9TVsSAnZWagAAO28P/A1PDHGn4RLUMtg/vRRB\nfm7yL++AIJgo8q5IpFRU8FREYE96qDxoCe4MJpQ8/7nlV/1O7AXUzrJgVXcL\notnDYC/wXOrBPQCZMGbs5gsUMnRjV17OtFLtd81EZukVFP6sH+xfdlt2yCzb\nuR1OYN7/DjKB+3ts9vQyYm08AgBdZ5ExDXqnQJ1nRbweyLGYoWqTNLBYWITd\nTTFSdIKDUv5Mnlfjr5zDFqnSkdzKNiUEVldY6+pLgVh0B/fA4homctivAcch\nS16d3iYORZTEe4664a+ND0+zD9Z/oYhdFTVy5azVDgOc/FNRT+JBSdyjDZmu\ngky34eYQAp2kAZ2mWCEhM1gllYjx1Evfb5tY80iF6ugX1QR4RXw67Sjcz38g\nDPUJGNWAYSQO4KFdNeas46JUhFKFW5IcXtCkDXi9ihVcXhObn/JwVlc1Itit\neaAxVg+dj1Q3eY2HNpZ8t8NJcdxiN2HxOXNJ8j2frj8QdlmnYyuUNELtYYPf\nxy7TfP2aIS2ZPpTb+pBmMFGrZoqGI/duIVkK2PIV9PDcbwd+2rld2yFrfuVv\nQ5aOUJ4+gCzELPOiL/plNMJSz+ximBXc3md08mSbcQKOp5yFQojv+njIkdcJ\ni8AdWDmqcEUKe3o4yPWZ/IXJoy3E/lbLM49ojlUHJSLpZ3c9atnkFsP1dUWK\nUi1q\r\n=7lp8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1mnHdjPxiwegYTMIJvIqoZLEi5yGdxCyQRiKCVUHQvAiBFE0JYDNtfJ6laZTrhiYiqedrm/zB1IZHLWpUsxObfGQ=="}]},"maintainers":[{"name":"blinkz","email":"cap.blinkz@gmail.com"}],"_npmUser":{"name":"blinkz","email":"cap.blinkz@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/portastic_1.0.1_1585562947726_0.14967733678247974"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-30T10:09:07.498Z","1.0.1":"2020-03-30T10:09:07.908Z","modified":"2022-04-04T19:32:58.459Z"},"maintainers":[{"name":"blinkz","email":"cap.blinkz@gmail.com"}],"description":"Pure javascript swiss knife for port management","homepage":"https://github.com/alanhoff/node-portastic#readme","keywords":["port","management","open ports","find open","interface"],"repository":{"type":"git","url":"git+https://github.com/alanhoff/node-portastic.git"},"author":{"name":"Alan Hoffmeister","email":"alanhoffmeister@gmail.com"},"bugs":{"url":"https://github.com/alanhoff/node-portastic/issues"},"license":"ISC","readme":"# portastic\n[![Coverage Status](https://coveralls.io/repos/alanhoff/node-portastic/badge.svg?branch=master)][0]\n[![Travis](https://travis-ci.org/alanhoff/node-portastic.svg)][1]\n[![Dependencies](https://david-dm.org/alanhoff/node-portastic.svg)][2]\n\nPure javascript swiss knife for port management. Find open ports, monitor ports\nand other port relates things.\n\n### API\n\n* `portastic.test(port, [interface , [callback]])`\n\nTest if a port is open. If a callback\nis provided it will be called with an `error` parameter and a second parameter\nwith a `boolean` that tells if the port is open or not. If a callback is not\nprovided the return value will be a promise that will be fullfied with the\nresult.\n\n```javascript\nvar portastic = require('portastic');\n\nportastic.test(8080)\n  .then(function(isOpen){\n    console.log('Port 8080 is %s', isOpen ? 'open' : 'closed');\n  });\n```\n\n* `portastic.find(options, [interface, [callback]])`\n\nRetrieve a list of open ports between `min` and `max`, if a callback is not\nprovided this method will resolve a promise with the results. Options can be:\n\n  * `min` The minimum port number to start with\n  * `max` The maximum port number to scan\n  * `retrieve` How many ports to collect\n\n```javascript\nvar portastic = require('portastic');\n\nportastic.find({\n    min: 8000,\n    max: 8080\n  })\n  .then(function(ports){\n    console.log('Ports available between 8000 and 8080 are: %s',\n      ports.join(', '));\n  });\n```\n\n* `portastic.filter(ports..., [interface, [callback]])`\n\nTest a list of ports and return the open ones. If a callback is not provided\nthis method will resolve a promise with the results\n\n```javascript\nvar portastic = require('portastic');\n\nportastic.filter([8080, 8081, 8082])\n  .then(function(ports){\n    console.log('The available ports are: %s', ports.join(', '));\n  });\n```\n\n* `portastic.Monitor(ports...)`\n\nMonitor is an `EventEmitter` that emits `open` when a monitored port is\navailable and `close` when the port has closed.\n\n```javascript\nvar portastic = require('portastic');\nvar monitor = new portastic.Monitor([8080, 8081, 8082]);\n\nmonitor.on('open', function(port){\n  console.log('Port %s is open', port);\n});\n\nmonitor.on('close', function(port){\n  console.log('Port %s is closed', port);\n});\n\nsetTimeout(function(){\n  monitor.stop(); // Stops the monitoring after 5 seconds\n}, 5000);\n```\n\n### Command line\n\nIt's also possible to use `portastic` as a command line utility, you just need\nto install it globally with `npm install -g portastic`. Here is the help command\noutput.\n\n```\n\nUsage: portastic [options] [command]\n\n\nCommands:\n\n  test|t <port>                 Test if a port is closed or open\n  find|f [options] <min> <max>  Find ports that are available to use\n  filter|i <ports...>           Find ports that are open whithin a list of ports\n  monitor|m <ports...>          Monitor a list of ports and logs to the terminal when port state had changed\n\nOptions:\n\n  -h, --help     output usage information\n  -V, --version  output the version number\n\n```\n\n### Testing\n\n```bash\ngit clone git@github.com:alanhoff/node-portastic.git\ncd node-portastic\nnpm install && npm test\n```\n\n### Debugging\n\nTo see debug messages you must set your enviroment variable `DEBUG` to `*` or\n`portastic:*`, example:\n\n```bash\nDEBUG=portastic:\\* npm test\n```\n\n### License (ISC)\n\n```\nCopyright (c) 2015, Alan Hoffmeister <alanhoffmeister@gmail.com>\n\nPermission to use, copy, modify, and distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n```\n\n[0]: https://coveralls.io/github/alanhoff/node-portastic\n[1]: https://travis-ci.org/alanhoff/node-portastic\n[2]: https://david-dm.org/alanhoff/node-portastic\n","readmeFilename":"README.md"}