{"_id":"bind-easy","_rev":"2149517","name":"bind-easy","description":"Easily create UDP sockets and TCP servers that bind to ports","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2022-01-04T20:36:18.000Z","created":"2021-09-21T14:22:56.719Z","1.1.0":"2022-01-04T20:33:17.541Z","1.0.2":"2021-10-08T11:44:46.384Z","1.0.1":"2021-09-21T15:04:41.226Z","1.0.0":"2021-09-21T14:22:56.719Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/bind-easy.git"},"versions":{"1.1.0":{"name":"bind-easy","version":"1.1.0","description":"Easily create UDP sockets and TCP servers that bind to ports","main":"index.js","scripts":{"test":"standard && brittle test.js"},"dependencies":{},"devDependencies":{"brittle":"^1.3.6","standard":"^16.0.3"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/bind-easy.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/bind-easy/issues"},"homepage":"https://github.com/mafintosh/bind-easy","gitHead":"64bca28d3dea2d2c863bc1dd5025578dce46a939","_id":"bind-easy@1.1.0","_nodeVersion":"16.8.0","_npmVersion":"6.14.15","dist":{"shasum":"ad321db1af2f49cd8f6519fb3f830e64b2b48e9d","size":3058,"noattachment":false,"key":"/bind-easy/-/bind-easy-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/bind-easy/download/bind-easy-1.1.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.1.0_1641328397349_0.5508472771385069"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-04T20:33:22.889Z","publish_time":1641328397541,"_cnpm_publish_time":1641328397541},"1.0.2":{"name":"bind-easy","version":"1.0.2","description":"Easily create UDP sockets and TCP servers that bind to ports","main":"index.js","scripts":{"test":"standard && brittle test.js"},"dependencies":{},"devDependencies":{"brittle":"^1.3.6","standard":"^16.0.3"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/bind-easy.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/bind-easy/issues"},"homepage":"https://github.com/mafintosh/bind-easy","gitHead":"00850ee75fb68e9b769c911da0d81d903cf5dd94","_id":"bind-easy@1.0.2","_nodeVersion":"16.8.0","_npmVersion":"6.14.15","dist":{"shasum":"feeb19ca6c7cfaa2b84938660bb9292498b3cd6b","size":2990,"noattachment":false,"key":"/bind-easy/-/bind-easy-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/bind-easy/download/bind-easy-1.0.2.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.0.2_1633693486272_0.278930229132093"},"_hasShrinkwrap":false,"publish_time":1633693486384,"_cnpm_publish_time":1633693486384},"1.0.1":{"name":"bind-easy","version":"1.0.1","description":"Easily create UDP sockets and TCP servers that bind to ports","main":"index.js","scripts":{"test":"standard && node test.js"},"dependencies":{},"devDependencies":{"brittle":"^1.0.0","standard":"^16.0.3"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/bind-easy.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/bind-easy/issues"},"homepage":"https://github.com/mafintosh/bind-easy","gitHead":"132e12f2ec90431f8d122e8558039ee31ea20322","_id":"bind-easy@1.0.1","_nodeVersion":"16.8.0","_npmVersion":"6.14.15","dist":{"shasum":"c1ab649b8909b9da86c99311a15f1d5698d74536","size":2980,"noattachment":false,"key":"/bind-easy/-/bind-easy-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/bind-easy/download/bind-easy-1.0.1.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.0.1_1632236681089_0.5551143699267322"},"_hasShrinkwrap":false,"publish_time":1632236681226,"_cnpm_publish_time":1632236681226},"1.0.0":{"name":"bind-easy","version":"1.0.0","description":"Easily create UDP sockets and TCP servers that bind to ports","main":"index.js","scripts":{"test":"standard && node test.js"},"dependencies":{},"devDependencies":{"brittle":"^1.0.0","standard":"^16.0.3"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/bind-easy.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/bind-easy/issues"},"homepage":"https://github.com/mafintosh/bind-easy","gitHead":"d33672e739f95600af27d0f50f11ade4c100bfb9","_id":"bind-easy@1.0.0","_nodeVersion":"16.8.0","_npmVersion":"6.14.15","dist":{"shasum":"a8894381d2b196ca62c4046999ae332126b23224","size":2958,"noattachment":false,"key":"/bind-easy/-/bind-easy-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/bind-easy/download/bind-easy-1.0.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.0.0_1632234176525_0.7496944570749815"},"_hasShrinkwrap":false,"publish_time":1632234176719,"_cnpm_publish_time":1632234176719}},"readme":"# bind-easy\n\nEasily create UDP sockets and TCP servers that bind to ports.\n\n```\nnpm install bind-easy\n```\n\n## Usage\n\n``` js\nconst bind = require('bind-easy')\n\n// bind to any port\nconst server = await bind.tcp()\n\n// try binding to a specific port, fallback to any\nconst server = await bind.tcp(8080)\n\n// try binding to a range of ports, fallback to any\nconst server = await bind.tcp([8080, 8081, 8082])\n\n// try binding to a range of ports, fallback to any\nconst server = await bind.tcp([8080, 8081, 8082])\n\n// try binding to a range of ports, fail if that cannot be done\nconst server = await bind.tcp([8080, 8081, 8082], { allowAny: false })\n\n// The same API applies for udp and dual mode\n\n// try binding to a range of UDP ports, fallback to any\nconst socket = await bind.udp([8080, 8081, 8082])\n\n// try binding to the same port for both a UDP socket and TCP server, fallback to any\nconst { server, socket } = await bind.dual(8080)\n```\n\n## API\n\n#### `server = await bind.tcp([ports], [{ allowAny }])`\n\nBind a TCP server. Pass a range of ports to try.\n\nIf none of the ports work, bind to a random free one unless allowAny is set.\nIf only one port is specified, it will try nearby ports first.\n\n#### `socket = await bind.udp(...)`\n\nSame but for a UDP socket.\n\n#### `{ server, socket } = await bind.dual(...)`\n\nSame but for both a TCP server and UDP socket binding to the same port.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/bind-easy","bugs":{"url":"https://github.com/mafintosh/bind-easy/issues"},"license":"MIT"}