{"_id":"killable","_rev":"196219","name":"killable","description":"Keeps track of a server's open sockets so they can be destroyed at a moment's notice.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"commandoline","email":"marten@marten-de-vries.nl"}],"time":{"modified":"2021-06-03T12:29:41.000Z","created":"2014-12-18T16:27:46.796Z","1.0.1":"2018-09-07T13:24:07.048Z","1.0.0":"2014-12-18T16:27:46.796Z"},"users":{"daizch":true},"author":{"name":"Marten de Vries"},"repository":{"type":"git","url":"git+https://github.com/marten-de-vries/killable.git"},"versions":{"1.0.1":{"name":"killable","version":"1.0.1","description":"Keeps track of a server's open sockets so they can be destroyed at a moment's notice.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/marten-de-vries/killable.git"},"keywords":["express","http","server","socket","kill","truncate","destroy","restart","shutdown","immeadiately"],"author":{"name":"Marten de Vries"},"license":"ISC","bugs":{"url":"https://github.com/marten-de-vries/killable/issues"},"gitHead":"6f7d56fdd366a08fddbe4ff8438c77e8643a5241","homepage":"https://github.com/marten-de-vries/killable#readme","_id":"killable@1.0.1","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"commandoline","email":"marten@marten-de-vries.nl"},"dist":{"shasum":"4c8ce441187a061c7474fb87ca08e2a638194892","size":1656,"noattachment":false,"key":"/killable/-/killable-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/killable/download/killable-1.0.1.tgz"},"maintainers":[{"name":"commandoline","email":"marten@marten-de-vries.nl"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/killable_1.0.1_1536326646938_0.1234895972624459"},"_hasShrinkwrap":false,"publish_time":1536326647048,"_cnpm_publish_time":1536326647048},"1.0.0":{"name":"killable","version":"1.0.0","description":"Keeps track of a server's open sockets so they can be destroyed at a moment's notice.","main":"index.js","repository":{"type":"git","url":"https://github.com/marten-de-vries/killable.git"},"keywords":["express","http","server","socket","kill","truncate","destroy","restart","shutdown","immeadiately"],"author":{"name":"Marten de Vries"},"license":"ISC","bugs":{"url":"https://github.com/marten-de-vries/killable/issues"},"gitHead":"cebeee0433e8bcfae70b313f007f52110e1e113b","_id":"killable@1.0.0","scripts":{},"_shasum":"da8b84bd47de5395878f95d64d02f2449fe05e6b","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"commandoline","email":"marten@marten-de-vries.nl"},"maintainers":[{"name":"commandoline","email":"marten@marten-de-vries.nl"}],"dist":{"shasum":"da8b84bd47de5395878f95d64d02f2449fe05e6b","size":1176,"noattachment":false,"key":"/killable/-/killable-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/killable/download/killable-1.0.0.tgz"},"directories":{},"publish_time":1418920066796,"_cnpm_publish_time":1418920066796,"_hasShrinkwrap":false}},"readme":"killable\n========\n\nKeeps track of a server's open sockets so they can be destroyed at a\nmoment's notice. This way, the server connection can be killed very\nfast.\n\nInstallation\n------------\n\n```\nnpm install killable\n```\n\nExample usage\n-------------\n\nUsing express:\n('server' in the example is just an ``http.server``, so other frameworks\nor pure Node should work just as well.)\n\n```javascript\nvar killable = require('killable');\n\nvar app = require('express')();\nvar server;\n\napp.route('/', function (req, res, next) {\n  res.send('Server is going down NOW!');\n\n  server.kill(function () {\n    //the server is down when this is called. That won't take long.\n  });\n});\n\nvar server = app.listen(8080);\nkillable(server);\n```\n\nAPI\n---\n\nThe ``killable`` module is callable. When you call it on a Node\n``http.Server`` object, it will add a ``server.kill()`` method on it. It\nreturns the server object.\n\n``server.kill([callback])`` closes all open sockets and calls\n``server.close()``, to which the ``callback`` is passed on.\n\nInspired by: http://stackoverflow.com/a/14636625\n\nLicense\n-------\n\nISC\n","_attachments":{},"homepage":"https://github.com/marten-de-vries/killable#readme","bugs":{"url":"https://github.com/marten-de-vries/killable/issues"},"license":"ISC"}