{"_id":"bind-easy","_rev":"6-e383fa7f53d2cbe4da646329952ced19","name":"bind-easy","dist-tags":{"latest":"1.1.2"},"versions":{"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":{"integrity":"sha512-Ull6C1VeiMjxc4KThKbMnijeeVNFvGt/Dw789g9LwLi/aPNJWc4PA4qrLWijJ9rkrGFxJzZ2aSyjeZ+Re67m1w==","shasum":"a8894381d2b196ca62c4046999ae332126b23224","tarball":"https://registry.npmjs.org/bind-easy/-/bind-easy-1.0.0.tgz","fileCount":6,"unpackedSize":9216,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFpaohejoni7+5Sh2wHeIHPiwre6KHy+Tz7pvBXUFA+SAiA9rTYhdrSlP9B8Z1J4/eqTcY5XRU6aLxOxWYvy/NUmng=="}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.0.0_1632234176525_0.7496944570749815"},"_hasShrinkwrap":false},"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":{"integrity":"sha512-cUPj6HcQh/8Y6/oH1yzcillGPzaixWaBWZjfi1+v7Jwqz5dkuJ77hV4UAoT86eJuYPAazddOJgz9Ds9zUEwQPA==","shasum":"c1ab649b8909b9da86c99311a15f1d5698d74536","tarball":"https://registry.npmjs.org/bind-easy/-/bind-easy-1.0.1.tgz","fileCount":6,"unpackedSize":9332,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhFTUrIYy05Oza0l1rOq+IGeB6fZtb26VS0DkswWYH2AiBoCDTA5mykev7Wvzx+iMnRJ8/WcogPkGjlvvTQ41AAcg=="}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.0.1_1632236681089_0.5551143699267322"},"_hasShrinkwrap":false},"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":{"integrity":"sha512-X2ojT4x+zrzzSOJ215eyVhZ+KhqDDE+Egs/M8Nz4ELXcwumQL7dFRxgUNDf+75qicLdm+6sXoGcTuk8lcZulhw==","shasum":"feeb19ca6c7cfaa2b84938660bb9292498b3cd6b","tarball":"https://registry.npmjs.org/bind-easy/-/bind-easy-1.0.2.tgz","fileCount":6,"unpackedSize":9540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEfKYFjabJG9VOJGSat5ah95TDV8zMNSmSCeSdsihhgHAiEA9FPXeGShSh1Vh8c0wCZR3uio5x/5Yg3lx6CpII3zFxg="}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.0.2_1633693486272_0.278930229132093"},"_hasShrinkwrap":false},"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":{"integrity":"sha512-QuQU4Z6BgduH+p9Tw6wAyA5vCy1yO6R7Ac2odlNqg5uQDpRKPj7BT92aFLThF/LjoIr9N9cgSl6RsqLcU3268g==","shasum":"ad321db1af2f49cd8f6519fb3f830e64b2b48e9d","tarball":"https://registry.npmjs.org/bind-easy/-/bind-easy-1.1.0.tgz","fileCount":6,"unpackedSize":10108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1K8NCRA9TVsSAnZWagAAjSoP/iWQffKeQRIYgtmI1f2n\n13Z1L9p6doGzEZTjTQzP/3GxHRJ0rfX23VDL8l/XGD3Y+Fo4KWAXijgsgz0O\nLPhWh0nmV/0YCMXU4gtB6XHsq5K/k65f+3IZBa6xq9/XUP5PhVZwwv3gbR7b\neqYJmNwnYkc9W6oHfYBZ+5E3sfUBi8ZlzP6/eWU5BSyLkDlyVaFQWdTETr24\n01AbrEnco0y7AEJ3kHIrdnE9OeeaI1/OjHQkwN3SNNARTkQiBXWpxLbYUy6v\nFtlS3BWWYVci0oY3dRNLpj58mB2qkiCBoKQC0TtR+g+ah514cTkMx9xEtjP5\nugIkf2j2/mDDSwTJKzQBx29MBkvKPYePJqgB3RZBtMKZQFgMBAELJaBBhQ4t\nT4IsLhNk/CRO9yg0kEFyZqOh/xf9hpqBmqshqxRnqwRRwO8yv03B/Wp2UINi\nIkwDoHNw234lNv8pRJNYSk/4AuMf6CukZ48XFBBE1tLqKCI+kFM4UJVM7qXc\n2UMdgVeU6rLjpc1+YCuO/ZrOSzNNxUqbeUsibC9CaQKb151ggINGWO4GaqBp\nrziLNfTycuf2PZy7NnZb6qbUShjXxD/mB2yzs0142pUVDy7FP/2iUQtKp5gI\nvqExHViFkMFxygU6aLtb6UEBLTYmuB9WypnkOdCQcCxyw2LdYQhtIGXJwgwS\nRdks\r\n=hs1d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIByFh+xwTxxothVYQ13fuECwwj34b0vaJj2KVDN+Ygs7AiAYtC06PYV+90XlwCSnYzBCotIgUqrTgFousZLvjV3N+Q=="}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.1.0_1641328397349_0.5508472771385069"},"_hasShrinkwrap":false},"1.1.1":{"name":"bind-easy","version":"1.1.1","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":"b81c27b628cf834c4c72e077bb69966262e0c1a3","_id":"bind-easy@1.1.1","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-kcApIimoMJQZjhOnhYb8EKzDskuajKpp993y9lCzJuCcG1is9jiZ/gvA9NJ6Uey8Lyww8KOM9ViSBVT0Zr67Ug==","shasum":"9c82cec5547744b1bbc3fd25b0055bcbddcdb483","tarball":"https://registry.npmjs.org/bind-easy/-/bind-easy-1.1.1.tgz","fileCount":6,"unpackedSize":10186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+QrcCRA9TVsSAnZWagAAHuQP/0cvyIQue0S6dQZEiFyY\nIJglg4f4UhQrce54tPE/ayG9z7FehbMjBin7MKBI3/MK9OH+0oFCdIxy1g17\niyNhpgzVkxPa2keG3OCq0hyxVkMkzEa7wXtxWGzKnLWrFwtUVQsoFDvMC5tF\nwV7YVmhnT6pOWeORiHw9LHX1yptrPkX+kMKIBEsVkUdfp8teOPFmH34u5KoD\nLfucJR9XsrKOL2HQuNb07VX0zzxms6YG+WxE62Vr18KeAtXgvIEQ6ZAjWpN/\n46D4Tt9qpFp94n2ULoEFBonbk8fIMFx2Q5BpJkWldw8l4lKnuzTeXTK0l6it\n9YKwiIBxsX8YG1VUxOSggN81M4ldv01ERyBycB8sDMpks0hPIbhwVMV8Jq09\naPdirKn8/wBuKwKzNYBZ7X6rQBH8CUwirCwlWVhB1uzk9VIto88npdoBzzMG\njKwDmYuMWBoHvql9L+oNZ5T9Jdd3nPJUmyOYD5jiAAmgzfHHbFxFoY3VtFIc\nrLLJ2L8Dheqsp7tkSu5v11a++rRgUsmuwfxfSU4zbCQQwsdpBxIqhLmdJxg0\n8nwBv4Ayys5iCgc+m6tx+BR+Zx6srtrVG+PR56MwVKgmwKZa1nSVguCQuo7m\niX7QB23MUzFmk0O81olLvYzg2eK449Dq9GLKHmTHUS6k+mwuxgauF//MyWkA\n9phc\r\n=ehAB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzo+HoEqZF7EG2H9NzHv/Mr/QArAGOkO9vWiAciEZsDgIhAONXrrohw0SOg46n8hL4/UJ7QbmxNx3X3c2sFWxHY3V9"}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.1.1_1643711196710_0.2576699423343969"},"_hasShrinkwrap":false},"1.1.2":{"name":"bind-easy","version":"1.1.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":"09798f071ff647c78fab0349ac63555a6ace289b","_id":"bind-easy@1.1.2","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-2+VjZ87WFdOFnsH4tHnmtf0HF6D2T3ZNdU1t1FYIz2jt4N3tyqbg2J0bYbflXdBkVi3xfVc8Pm8NB062SPvVVA==","shasum":"d10f9be896e53fb84f49465be5b1ab9b089dbcff","tarball":"https://registry.npmjs.org/bind-easy/-/bind-easy-1.1.2.tgz","fileCount":6,"unpackedSize":10249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+Tr0CRA9TVsSAnZWagAAfmIP/jeWR9QnGCVd9X4eiBef\n2957u0x6xMtcikKKX47gAGbuGDOc+SuYU21amsqjhOsVrMTJqUqkMJSbuKqz\nU/K/hD9wfii6e/yWLvLLNdMc0z3diL7HVIBy4zPkftVEzJzPgxrAO/KgxB5T\n9+Ec5XB+KB/diFhTioM0KuDP3XjeGzs/XL31vaIkc9Ik6A0tGBoAvZ7ueV5b\nU+P85k0CZYWtKYDYT+X27JaffuNioCSY1imL2PSFC8bLyPu+aCbGDAcF7NCT\nIxMrliwuDruunN0pCWMfHPxEzGl/O2CY7NqORvNsy9gchwDKfbuQXQlHJbzB\nGEjl2aweHsx1Xp2qWTWooCmhx0jMCH4ygx9ulD9/+XHbKNEgjTxJYIaqry5Q\njuhdwxR7JJbtKPFnSMBXTSwH7U014c5SMUwKQDhWNTLVFLYc7hWezGZfm+28\n2xURKuNoJYG8HNEFGWDtvxayjtEii3lcHKhG13uQwdGNSmEQZz+WwmFUlyjE\nX3MZy8GR+N5yVh3w2cW7JNkNYEOy+J6raXKjlDSCNPJ7WT6vnuDEqIaW7937\nrLd88Kw0hR8s/LctK8J2rqMoAm0tKPClE+QhxxYxWZsZZQDKGfSzGzkw4I9w\ndSdIcGTWglB0T8FJALFt1/LDzNveXrkoqZKor1lvGQZuKYsmkof/0V0dgLVt\nvTrM\r\n=bthX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqGyGttwT9b/0T5N6AY8unN0C7KSi54Cp/F0dMdRmXfAIhAIQP4eI0s/KgIk7/fYffHoIQP15+PoKlSjMI77Gk4YlS"}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bind-easy_1.1.2_1643723508312_0.8736501210108771"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-21T14:22:56.524Z","1.0.0":"2021-09-21T14:22:56.719Z","modified":"2022-04-11T17:49:32.834Z","1.0.1":"2021-09-21T15:04:41.226Z","1.0.2":"2021-10-08T11:44:46.384Z","1.1.0":"2022-01-04T20:33:17.541Z","1.1.1":"2022-02-01T10:26:36.861Z","1.1.2":"2022-02-01T13:51:48.439Z"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"description":"Easily create UDP sockets and TCP servers that bind to ports","homepage":"https://github.com/mafintosh/bind-easy","repository":{"type":"git","url":"git+https://github.com/mafintosh/bind-easy.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"bugs":{"url":"https://github.com/mafintosh/bind-easy/issues"},"license":"MIT","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","readmeFilename":"README.md"}