{"_id":"tcp-ping","_rev":"21-45b109684f0680c127d043de6dd89ca5","name":"tcp-ping","description":"A ping utility using TCP connection","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"tcp-ping","version":"0.0.1","description":"A ping utility using TCP connection","main":"ping.js","scripts":{"test":"echo 0"},"repository":{"type":"git","url":"https://github.com/wesolyromek/tcp-ping.git"},"keywords":["ping","util","tcp","availability"],"author":{"name":"Adam Paszke"},"license":"MIT","bugs":{"url":"https://github.com/wesolyromek/tcp-ping/issues"},"homepage":"https://github.com/wesolyromek/tcp-ping","_id":"tcp-ping@0.0.1","dist":{"shasum":"5c9b2dd6525e3581cab626928c1f7cea1ad165f8","tarball":"https://registry.npmjs.org/tcp-ping/-/tcp-ping-0.0.1.tgz","integrity":"sha512-gzDw6jMJmV53KiX0WzI+ucl98+e3wRhfwxXAcvVE7RJrlnyaIeNoHSCEAZjk7WVy6ONhvPZrzDiDlRDMNmtNuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHpX2g2ZqcTuEjos2esHo9nhnu5RIzSc/iWds/yGHmVAiEAgDQL1rehulFhybEGy8cd7IjVtPAl186SORi5sQuy78E="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"wesolyromek","email":"adam.paszke@gmail.com"},"maintainers":[{"name":"wesolyromek","email":"adam.paszke@gmail.com"}],"directories":{}},"0.1.0":{"name":"tcp-ping","version":"0.1.0","description":"A ping utility using TCP connection","main":"ping.js","scripts":{"test":"echo 0"},"repository":{"type":"git","url":"https://github.com/wesolyromek/tcp-ping.git"},"keywords":["ping","util","tcp","availability"],"author":{"name":"Adam Paszke"},"license":"MIT","bugs":{"url":"https://github.com/wesolyromek/tcp-ping/issues"},"homepage":"https://github.com/wesolyromek/tcp-ping","_id":"tcp-ping@0.1.0","dist":{"shasum":"be833fd2bfab7ce06592b3945dc5c01a96c4c635","tarball":"https://registry.npmjs.org/tcp-ping/-/tcp-ping-0.1.0.tgz","integrity":"sha512-KyoRI9eubkHOZrSs5HFb5Pp2GV20RMiUTCK9imN1UZdPXqFJXbbaoE873vMi0gW2onTYpOnuqE6I5C0GUyx2bg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG15C98Vb81XhjahA+3N+vay8TTbVwmzVACH2msLZJ1pAiBH4KjZ1todoxsTneLaichQv/aD2bHz7KSp0tip8KwOpw=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"wesolyromek","email":"adam.paszke@gmail.com"},"maintainers":[{"name":"wesolyromek","email":"adam.paszke@gmail.com"}],"directories":{}},"0.1.1":{"name":"tcp-ping","version":"0.1.1","description":"A ping utility using TCP connection","main":"ping.js","scripts":{"test":"echo 0"},"repository":{"type":"git","url":"https://github.com/wesolyromek/tcp-ping.git"},"keywords":["ping","util","tcp","availability"],"author":{"name":"Adam Paszke"},"license":"MIT","bugs":{"url":"https://github.com/wesolyromek/tcp-ping/issues"},"homepage":"https://github.com/wesolyromek/tcp-ping","_id":"tcp-ping@0.1.1","dist":{"shasum":"02dd7f42b5bf7d7cb78d5b7aacefa155fd8f7c0c","tarball":"https://registry.npmjs.org/tcp-ping/-/tcp-ping-0.1.1.tgz","integrity":"sha512-7Ed10Ds0hYnF+O1lfiZ2iSZ1bCAj+96Madctebmq7Y1ALPWlBY4YI8C6pCL+UTlshFY5YogixKLpgDP/4BlHrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIECy4pCgSWsOq/iRu+WZaVnUQ0WMMMMZ6pollQ3zgFV5AiAdnqoqbQjdW9M3mquNCuariWw22KvTavc3hwJ6W388HQ=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"wesolyromek","email":"adam.paszke@gmail.com"},"maintainers":[{"name":"wesolyromek","email":"adam.paszke@gmail.com"}],"directories":{}}},"readme":"tcp-ping\n========\n\nTCP ping utility for node.js. You can test if chosen address accepts connections at desired port and find out your latency. Great for service availability testing.\n\n#####Why not ```ping``` wrapper?\n\n* It's much faster than ```ping``` tool (as soon as connection gets accepted, it's dropped and a new measure is conducted immediately), so there's no unnecessary waiting between requests.\n* It allows you to test a specific service, not the whole connection\n* Some servers drop ICMP echo without any response, even when online. TCP can work in such cases.\n\n###Install\n\n```\nnpm install tcp-ping\n```\n\n###Functions\n\n#####ping(options, callback)\n\n```options``` is an object, which may contain several properties:\n\n* address (address to ping; defaults to ```localhost```)\n* port (defaults to ```80```)\n* timeout (in ms; defaults to 5s)\n* attempts (how many times to measure time; defaults to 10)\n\n```callback``` should be a function with arguments in node convention - ```function(err, data)```.\n\nReturned data is an object which looks like this:\n```javascript\n{\n  address: '46.28.246.123',\n  port: 80,\n  attempts: 10,\n  avg: 19.7848844,\n  max: 35.306233,\n  min: 16.526067,\n  results:\n   [\n    { seq: 0, time: 35.306233 },\n    { seq: 1, time: 16.585919 },\n    ...\n    { seq: 9, time: 17.625968 }\n   ]\n}\n```\n\n#####probe(address, port, callback)\n```callback``` is a node style callback ```function(err, data)```, where data is true if the server is available and false otherwise.\n\n###Usage\n\n```javascript\nvar tcpp = require('tcp-ping');\n\ntcpp.probe('46.28.246.123', 80, function(err, available) {\n    console.log(available);\n});\n\ntcpp.ping({ address: '46.28.246.123' }, function(err, data) {\n    console.log(data);\n});\n```","maintainers":[{"name":"wesolyromek","email":"adam.paszke@gmail.com"}],"time":{"modified":"2022-06-27T04:15:50.370Z","created":"2014-04-26T20:32:35.246Z","0.0.1":"2014-04-26T20:32:35.246Z","0.1.0":"2014-04-29T08:23:33.254Z","0.1.1":"2014-09-03T13:52:28.556Z"},"homepage":"https://github.com/wesolyromek/tcp-ping","keywords":["ping","util","tcp","availability"],"repository":{"type":"git","url":"https://github.com/wesolyromek/tcp-ping.git"},"author":{"name":"Adam Paszke"},"bugs":{"url":"https://github.com/wesolyromek/tcp-ping/issues"},"license":"MIT","readmeFilename":"README.md","users":{"kailuo":true,"mr1024":true,"f124275809":true,"edin-m":true,"erincinci":true,"fernando-araujo":true,"yuchen3102034":true,"potnox":true,"xunnamius":true,"ys_sidson_aidson":true,"jag82":true,"touskar":true,"jochemstoel":true}}