# dezalgo

> Contain async insanity so that the dark pony lord doesn't eat souls

Latest version **1.0.4** (published 2022-04-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install dezalgo
pnpm add dezalgo
yarn add dezalgo
bun add dezalgo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-04-06 |
| First published | 2014-06-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 92 |
| Author | Isaac Z. Schlueter |
| Maintainers | fritzy, darcyclarke, ruyadorno, nlf, gar, lukekarrys |
| Keywords | async, zalgo, the dark pony, he comes, asynchrony of all holy and good, To invoke the hive mind representing chaos, Invoking the feeling of chaos. /Without order, The Nezperdian Hive Mind of Chaos, (zalgo………………), He who waits beyond the wall, ZALGO, HE COMES, there used to be some funky unicode keywords here, but it broke the npm website on chrome, so they were removed, sorry |

## Links

- npm: https://www.npmjs.com/package/dezalgo
- Repository: https://github.com/npm/dezalgo
- Issues: https://github.com/npm/dezalgo/issues
- npm.io page: https://npm.io/package/dezalgo

## Dependencies (2)

- [asap](https://npm.io/package/asap.md) ^2.0.0
- [wrappy](https://npm.io/package/wrappy.md) 1

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2022-04-06
- 1.0.3 — 2015-06-19
- 1.0.2 — 2015-05-21
- 1.0.1 — 2014-09-18
- 1.0.0 — 2014-06-30

## README

# 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)
  })
}
```

---
_Source: https://npm.io/package/dezalgo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
