{"name":"endpoint-utils","version":"1.0.2","description":"Utils to deal with TCP ports and hostnames. Safe for everyday use.","main":"index.js","scripts":{"test":"mocha","publish-please":"publish-please","prepublish":"publish-please guard"},"repository":{"type":"git","url":"git+https://github.com/inikulin/endpoint-utils.git"},"keywords":["free","port","get","check","tcp","server","http","host","hostname","mine"],"author":{"name":"Ivan Nikulin","email":"ifaaan@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/inikulin/endpoint-utils/issues"},"homepage":"https://github.com/inikulin/endpoint-utils#readme","dependencies":{"ip":"^1.1.3","pinkie-promise":"^1.0.0"},"devDependencies":{"mocha":"^2.3.3","publish-please":"^2.1.4"},"files":["index.js"],"gitHead":"28b750dcdce5e0c5b9d82d51b3f8f25fa9e07942","_id":"endpoint-utils@1.0.2","_shasum":"0808c3369a727cd7967a39ff34ebc926b88146a8","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.1","_npmUser":{"name":"inikulin","email":"ifaaan@gmail.com"},"dist":{"shasum":"0808c3369a727cd7967a39ff34ebc926b88146a8","tarball":"http://registry-npm.ywwl.com/endpoint-utils/download/endpoint-utils-1.0.2.tgz","integrity":"sha512-s5IrlLvx7qVXPOjcxjF00CRBlybiQWOoGCNiIZ/Vin2WeJ3SHtfkWHRsyu7C1+6QAwYXf0ULoweylxUa19Khjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9C2ykXOif+DUdIJbXeAFUfOqGIk/Xk67nxoiof6JSsAiEAnE1pkja4YT98AxSnXT6eZTepOYT5+H+GwdR9JUh1bRI="}],"size":2375,"noattachment":false,"key":"/endpoint-utils/-/endpoint-utils-1.0.2.tgz"},"maintainers":[{"name":"inikulin","email":"ifaaan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/endpoint-utils-1.0.2.tgz_1467195590307_0.6794634298421443"},"readme":"# endpoint-utils\n[![Build Status](https://api.travis-ci.org/inikulin/endpoint-utils.svg)](https://travis-ci.org/inikulin/endpoint-utils)\n\n*Utils to deal with TCP ports and hostnames. Safe for everyday use.*\n\n## Install\n```\nnpm install endpoint-utils\n```\n\n## Usage\n### Get free port\n```js\nconst getFreePort = require('endpoint-utils').getFreePort;\n\ngetFreePort().then(port => {\n    console.log(port);\n    //> 1337\n});\n```\n\n### Get multiple free ports\n```js\nconst getFreePorts = require('endpoint-utils').getFreePorts;\n\ngetFreePorts(3).then(ports => {\n    console.log(ports);\n    //> [1337, 1338, 1339]\n});\n```\n\n### Check if port is free\n```js\nconst isFreePort = require('endpoint-utils').isFreePort;\n\nisFreePort(1337).then(isFree => {\n    console.log(isFree);\n    //> true\n});\n```\n\n### Check if hostname or IP address resolves to the current machine\n```js\nconst isMyHostname = require('endpoint-utils').isMyHostname;\n\nisMyHostname('inikulin').then(isMy => {\n    console.log(isMy);\n    //> true\n});\n\nisMyHostname('172.22.5.80').then(isMy => {\n    console.log(isMy);\n    //> true\n});\n```\n\n### Get hostname or IP address which can be resolved to the current machine\n```js\nconst getMyHostname = require('endpoint-utils').getMyHostname;\n\ngetMyHostname().then(hostname => {\n    console.log(hostname);\n    //> \"inikulin.local\"\n});\n```\n\n### Get IP address of current machine\n```js\nconst getIPAddress = require('endpoint-utils').getIPAddress;\n\nconsole.log(getIPAddress());\n//> \"172.22.5.80\"\n```\n\n## Author\n[Ivan Nikulin](https://github.com/inikulin) (ifaaan@gmail.com)\n","publish_time":1467195592940,"_cnpm_publish_time":1467195592940,"dist-tags":{"latest":"1.0.2","preview":"1.0.4-preview"}}