{"name":"endpoint-utils","version":"1.0.2-preview","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":"15224987e947e4b8cd1d2382313c13f7b67ebdbe","_id":"endpoint-utils@1.0.2-preview","_shasum":"479804928c14d779a70203d0560a5e64428af485","_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":"479804928c14d779a70203d0560a5e64428af485","tarball":"http://registry-npm.ywwl.com/endpoint-utils/download/endpoint-utils-1.0.2-preview.tgz","integrity":"sha512-cfd1H2IH4yu6vVvo4Fb/aQ3t/fyX4TFrzL78wG6VSvG7VMctOxhnTpWwVUvfZQxju39h08wZM9UaudWBO2INGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC7LmhglRbJUoEbl4F1BxaZY1bIx53k7UD5BcO85ZhykAiEAm9yhB4H2UCHg8eFf82eJTlpTq7kA8EJGH+Lbl6oVxXs="}],"size":2272,"noattachment":false,"key":"/endpoint-utils/-/endpoint-utils-1.0.2-preview.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":1449577350712,"_cnpm_publish_time":1449577350712,"dist-tags":{"latest":"1.0.2","preview":"1.0.4-preview"}}