{"name":"endpoint-utils","version":"1.0.0","description":"Utils to deal with TCP ports and hostnames. Safe for everyday use.","main":"index.js","scripts":{"test":"mocha"},"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":{"pinkie-promise":"^1.0.0"},"devDependencies":{"ip":"^1.0.1","mocha":"^2.3.3"},"files":["index.js"],"gitHead":"812dc3a1d90bfd1a6b75c0e2247425720731fabc","_id":"endpoint-utils@1.0.0","_shasum":"6b62bbbb0373327571ff810272a043fcd469fcb3","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"inikulin","email":"ifaaan@gmail.com"},"dist":{"shasum":"6b62bbbb0373327571ff810272a043fcd469fcb3","tarball":"http://registry-npm.ywwl.com/endpoint-utils/download/endpoint-utils-1.0.0.tgz","integrity":"sha512-ACGxrdwluxqfzcYa03No5RGkFppZCyMATLs8nhVBbMkMz1C27bTg0KzeVi5hD4pGmhM4wLwaYz/1WTPMKsHHmA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZD65zZkKtHBzux6utW/va++Ni4tCeZZyEl5qwdkXRwAiEA07BYtMEHsQZpsv60fS7pJbACGIKPUcOvwDeaoMN+AJ0="}],"size":2221,"noattachment":false,"key":"/endpoint-utils/-/endpoint-utils-1.0.0.tgz"},"maintainers":[{"name":"inikulin","email":"ifaaan@gmail.com"}],"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":1444825432664,"_cnpm_publish_time":1444825432664,"dist-tags":{"latest":"1.0.2","preview":"1.0.4-preview"}}