{"_id":"hang","_rev":"269037","name":"hang","description":"Force the supplied callback in to async execution","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"3rdeden","email":""}],"time":{"modified":"2023-06-28T12:13:39.000Z","created":"2015-04-07T09:53:56.439Z","1.0.0":"2015-04-07T09:53:56.439Z"},"users":{},"author":{"name":"Arnout Kazemier"},"repository":{"type":"git","url":"https://github.com/unshiftio/hang"},"versions":{"1.0.0":{"name":"hang","version":"1.0.0","description":"Force the supplied callback in to async execution","main":"index.js","scripts":{"100%":"istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100","test":"mocha test.js","watch":"mocha --watch test.js","coverage":"istanbul cover ./node_modules/.bin/_mocha -- test.js","test-travis":"istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js"},"repository":{"type":"git","url":"https://github.com/unshiftio/hang"},"keywords":["dont","keep","me","hanging","bro","hang","suspend","wait","defer","deferred","wating","delay","async","force","sync","execution","callback","pattern"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/unshiftio/hang/issues"},"homepage":"https://github.com/unshiftio/hang","devDependencies":{"assume":"1.2.x","istanbul":"0.3.x","mocha":"2.2.x","pre-commit":"1.0.x"},"gitHead":"91b398ce124a8c48ab2618bc963fb4c8ec3b5f81","_id":"hang@1.0.0","_shasum":"67050879844435e02ae0409c4f4553c6438e1d71","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.35","_npmUser":{"name":"3rdeden","email":"npm@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":""}],"dist":{"shasum":"67050879844435e02ae0409c4f4553c6438e1d71","size":3164,"noattachment":false,"key":"/hang/-/hang-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/hang/download/hang-1.0.0.tgz"},"directories":{},"publish_time":1428400436439,"_hasShrinkwrap":false,"_cnpm_publish_time":1428400436439,"_cnpmcore_publish_time":"2021-12-18T20:41:55.753Z"}},"readme":"# hang\n\n[![Made by unshift][made-by]](http://unshift.io)[![Version npm][version]](http://browsenpm.org/package/hang)[![Build Status][build]](https://travis-ci.org/unshiftio/hang)[![Dependencies][david]](https://david-dm.org/unshiftio/hang)[![Coverage Status][cover]](https://coveralls.io/r/unshiftio/hang?branch=master)[![IRC channel][irc]](http://webchat.freenode.net/?channels=unshift)\n\n[made-by]: https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square\n[version]: https://img.shields.io/npm/v/hang.svg?style=flat-square\n[build]: https://img.shields.io/travis/unshiftio/hang/master.svg?style=flat-square\n[david]: https://img.shields.io/david/unshiftio/hang.svg?style=flat-square\n[cover]: https://img.shields.io/coveralls/unshiftio/hang/master.svg?style=flat-square\n[irc]: https://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square\n\n`hang` is micro helper function that will guarantee that your callbacks are\ncalled async. The returned function can be called in sync or completely async.\nWhen it's called in `sync` we will \"hang\" execution in a `setImmidiate` or\n`setTimeout(0)` to ensure that it's called in async.\n\n## Installation\n\nThe module is released in the public npm registry and can be installed by\nrunning:\n\n```\nnpm install --save hang\n```\n\n## Usage\n\nRequire the module and supply it the function that should be called in\ncompletely async:\n\n```js\n'use strict';\n\nvar hang = require('hang');\n\nvar fn = hang(function (foo) {\n  console.log(this, foo); // foo, bar\n});\n\nfn.call('foo', 'bar')\n\n//\n// Or call it \"async\"\n//\nsetTimeout(function () {\n  fn.call('foo', 'bar')\n}, 10);\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/unshiftio/hang","bugs":{"url":"https://github.com/unshiftio/hang/issues"},"license":"MIT"}