{"_id":"harbor","_rev":"12-ec9c8e3e97a1b297af5f03704b090d6a","name":"harbor","description":"TCP port availability and assignment utility.","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"harbor","version":"0.1.0","description":"TCP port availability and assignment utility.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/logicalparadox/harbor.git"},"keywords":["port"],"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"license":"MIT","dependencies":{"debug":"*"},"devDependencies":{"mocha":"*","chai":"*","chai-spies":"*"},"_id":"harbor@0.1.0","dist":{"shasum":"35543f7f03d790c4d1467702d8e20c30eaae9f32","tarball":"https://registry.npmjs.org/harbor/-/harbor-0.1.0.tgz","integrity":"sha512-rkNiw39c2eTQHT3I6JnME3eAlfYXZAIQpwwiifh2HULlOmVF1DllhwxAzlJNqLnlMhi64U0LQjoOqHNn5aMu3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHRV8Avdk6q+xD3I8sG2c++gOpXQV9eoJs4ojZggwkpWAiEApaVvNaGiw++s1Zb2TGmCcFDoQXBOdir8/vxoMuyMITE="}]},"maintainers":[{"name":"jakeluer","email":"jake@alogicalparadox.com"}]},"0.1.1":{"name":"harbor","version":"0.1.1","description":"TCP port availability and assignment utility.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/logicalparadox/harbor.git"},"keywords":["port"],"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"license":"MIT","dependencies":{"debug":"*"},"devDependencies":{"mocha":"*","chai":"*","chai-spies":"*"},"_id":"harbor@0.1.1","dist":{"shasum":"0509ae63a41ff4090e46a40796bdd0cfb12a8fe0","tarball":"https://registry.npmjs.org/harbor/-/harbor-0.1.1.tgz","integrity":"sha512-FYr+sPW2M458hmvAw/4qrutxFhWBPKo/izkSgUuSsFIefRQJN4qBGKKeES8YdbRtsnQYXj4jGMzxgLiGPYTmYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgZTRn2h9PehlGALzT8C+ivSArMy6efsU+Nu1SYz973QIgA8YKZ/cRoV1N5RnJi+YOORp+5gpYO7ooWJv9o/m1zwE="}]},"maintainers":[{"name":"jakeluer","email":"jake@alogicalparadox.com"}]},"0.2.0":{"name":"harbor","version":"0.2.0","description":"TCP port availability and assignment utility.","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/logicalparadox/harbor.git"},"keywords":["port"],"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"license":"MIT","dependencies":{},"devDependencies":{"mocha":"*","chai":"*","chai-spies":"*"},"_id":"harbor@0.2.0","dist":{"shasum":"774774c431ab2695c142eb51e79b3d37ab555c91","tarball":"https://registry.npmjs.org/harbor/-/harbor-0.2.0.tgz","integrity":"sha512-Xb0IijmLy1ffjNTybtvkiqWyu8Te7/CFjPv2IE3SNQi9OoEcBEDxNfmlHoFnTgWqCoJpeqVtBeR7LJVmuwdX7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcvrLG1uXkibY5SFc8Pjei3pfd4l6WVopTbvPOASBbmAIgQfSlfr9uH4BkCuvHKGGdDei81m3sQp+zw0g1uwbybn8="}]},"maintainers":[{"name":"jakeluer","email":"jake@alogicalparadox.com"}]},"0.3.0":{"name":"harbor","version":"0.3.0","description":"TCP port availability and assignment utility.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/logicalparadox/harbor.git"},"keywords":["port"],"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"license":"MIT","dependencies":{},"devDependencies":{"chai":"*","chai-spies":"*","mocha":"*"},"bugs":{"url":"https://github.com/logicalparadox/harbor/issues"},"homepage":"https://github.com/logicalparadox/harbor","_id":"harbor@0.3.0","_shasum":"c2fbf9627de5366e140bc764c26078732c62997a","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jakeluer","email":"jake@alogicalparadox.com"},"maintainers":[{"name":"jakeluer","email":"jake@alogicalparadox.com"}],"dist":{"shasum":"c2fbf9627de5366e140bc764c26078732c62997a","tarball":"https://registry.npmjs.org/harbor/-/harbor-0.3.0.tgz","integrity":"sha512-uhCb0qkqYPP8v6mg6nIxm9/fzcPJpQ6vL2ln7BFiSBMBtOjsey7kcYB/czPtW4h1O48sgwVKKRqO2oOCHvvC9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4Y39akGguTi9jfUSk4pS2HEK7ixWIHCSPp5ung0eS1wIgO2vnUkQuVFF/jL5XqKTdVDsb/6NGqSoW3zFYYqGRXAg="}]}}},"readme":"# Harbor [![Build Status](https://secure.travis-ci.org/logicalparadox/harbor.png?branch=master)](http://travis-ci.org/logicalparadox/harbor)\n\n> TCP port availability and assignment utility.\n\nHarbor is a small little tool to find available TCP ports within a given range. It will remember\nwhat server is assigned to each port, or which ports are unavailable due to system assignment.\n\n## Installation\n\nHarbor can be installed via [npm](http://npmjs.org).\n\n```sh\nnpm install harbor\n```\n\n## Quick Start\n\nInvoke the `harbor` primary export with a lower and upper bounds of port number to query. Then\nclaim a service name to query for an available port.\n\n```js\nvar harbor = require('harbor')(1227, 1337);\n\nharbor.claim('awesomeness', function (err, port) {\n  if (err) throw err;\n  console.log(port); // 1227\n});\n```\n\n## API Reference\n\n### Harbor\n\nThe primary export is a factory, but you can also create new Harbors manually.\n\n```js\nvar Harbor = require('harbor')\n  , harbor = new Harbor(1227, 1337);\n```\n\nThe `harbor` constructor object is also an event emitter. \n\n- `claim (name, port)` upon claim of a port\n- `release (name, port)` upon release of a port\n- `full` upon all ports being claimed\n\nShould you run out of ports, you can adjust the `harbor.min` or `harbor.max` to your needs.\n\n#### .claim (name, cb)\n\n- **@param** _{String}_ service name\n- **@param** _{Function}_ callback\n\nFind an available port for a named service. Names must be unique within a given Harbor. If\na claim for a name that already exists, the already assigned port will be returned.\n\nWill emit `claim` event for new, successful claims. Alternatively could emit `full` event in\naddition to returning an error in the callback.\n\n```js\nharbor.claim('awesomeness', function (err, port) {\n  if (err) throw err; // will occur if all available ports are claimed\n  console.log(port); // 1227\n});\n```\n\n#### .release (name)\n\n- **@param** _{String}_ service name\n\nIndicate that the claimed port for `name` is no longer in use and can be returned\nto the pool of available ports. \n\nWill emit `release` event if the port was previously claimed. Releasing a service \nname that does not exist has no impact.\n\n```js\nharbor.release('awesomeness');\n```\n\n#### .claimed\n\n- **@returns** _{Array}_ claimed ports\n\nGet an array of all claimed ports by this harbor interface. Does not include \nports that are in use by system services within the harbor range.\n\n## Tests\n\nTests are written in the BDD styles for the [Mocha](http://visionmedia.github.com/mocha) \ntest runner using the `should` assertion interface from [Chai](http://chaijs.com). \nRunning tests is simple:\n\n    npm test\n\n## Contributing\n\nInterested in contributing? Fork to get started. Contact [@logicalparadox](http://github.com/logicalparadox) \nif you are interested in being regular contributor.\n\n#### Contibutors \n\n* Jake Luer ([@logicalparadox](http://github.com/logicalparadox))\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","maintainers":[{"name":"jakeluer","email":"jake@alogicalparadox.com"}],"time":{"modified":"2022-06-18T19:20:59.057Z","created":"2012-08-07T09:11:38.044Z","0.1.0":"2012-08-07T09:11:38.930Z","0.1.1":"2012-08-07T10:31:22.752Z","0.2.0":"2012-08-10T16:36:32.841Z","0.3.0":"2014-10-01T13:09:36.747Z"},"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"repository":{"type":"git","url":"git://github.com/logicalparadox/harbor.git"},"homepage":"https://github.com/logicalparadox/harbor","keywords":["port"],"bugs":{"url":"https://github.com/logicalparadox/harbor/issues"},"license":"MIT","readmeFilename":"README.md","users":{"meganekick":true}}