{"name":"endpoint-utils","version":"1.0.1","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","ip":"^1.0.1"},"devDependencies":{"mocha":"^2.3.3"},"files":["index.js"],"gitHead":"66f558d03f76e87734e83830e2fb524d1a4b8fb0","_id":"endpoint-utils@1.0.1","_shasum":"23b8cd9c593f626507087fd6d1f7460055536091","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"inikulin","email":"ifaaan@gmail.com"},"maintainers":[{"name":"inikulin","email":"ifaaan@gmail.com"}],"dist":{"shasum":"23b8cd9c593f626507087fd6d1f7460055536091","tarball":"http://registry-npm.ywwl.com/endpoint-utils/download/endpoint-utils-1.0.1.tgz","integrity":"sha512-INh4zAGUsrfnGR/BQOY3yXfH2uaYMqnWnNkHbc2VUSP/g/3vwvkHM3UTUYDfC7F4hyV4XRe+6Bng5ImCnH2Dxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFTHuI+FBkwqjVm8DmrNLrpenHTUVL7pD+u5uRV2ZeHCAiEAqkt5mkk9tChOjlYwqZ6ZV8BO4/er7oD5E6HGXK5reg4="}],"size":2269,"noattachment":false,"key":"/endpoint-utils/-/endpoint-utils-1.0.1.tgz"},"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":1446150603858,"_cnpm_publish_time":1446150603858,"dist-tags":{"latest":"1.0.2","preview":"1.0.4-preview"}}