Current Path: > > lib > node_modules > npm > node_modules > dezalgo
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
.travis.yml | File | 111 bytes | March 10 2021 14:36:40. | |
LICENSE | File | 765 bytes | March 10 2021 14:36:40. | |
README.md | File | 651 bytes | March 10 2021 14:36:40. | |
dezalgo.js | File | 368 bytes | March 10 2021 14:36:40. | |
package.json | File | 3229 bytes | March 10 2021 14:36:40. |
# dezalgo Contain async insanity so that the dark pony lord doesn't eat souls See [this blog post](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). ## USAGE Pass a callback to `dezalgo` and it will ensure that it is *always* called in a future tick, and never in this tick. ```javascript var dz = require('dezalgo') var cache = {} function maybeSync(arg, cb) { cb = dz(cb) // this will actually defer to nextTick if (cache[arg]) cb(null, cache[arg]) fs.readFile(arg, function (er, data) { // since this is *already* defered, it will call immediately if (er) cb(er) cb(null, cache[arg] = data) }) } ```
SILENT KILLER Tool