# asyncifyjs

> Make CPU intensive code asynchronous just like Javascript IO call

Latest version **1.1.0** (published 2015-11-25) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2015-11-25 |
| First published | 2015-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Maiah Macariola |
| Maintainers | maiah |
| Keywords | concurrency, csp, thread, webworker, worker, async |

## Links

- npm: https://www.npmjs.com/package/asyncifyjs
- Repository: https://github.com/maiah/asyncifyjs
- Homepage: https://github.com/maiah/asyncifyjs#readme
- Issues: https://github.com/maiah/asyncifyjs/issues
- npm.io page: https://npm.io/package/asyncifyjs

## Dependencies (1)

- [tiny-worker](https://npm.io/package/tiny-worker.md) ^1.1.1

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-11-25
- 1.0.1 — 2015-11-22
- 1.0.0 — 2015-11-22

## README

# asyncify
Make your non-IO JavaScript code asynchronous non-blocking just like Node.js non-blocking IO. This is perfect for CPU intensive code.

# Installation
```sh
npm install --save asyncifyjs
```

# Usage
```js
const asyncify = require('asyncifyjs');

function fib(num) {
    if (num === 0) return 0;
    else if (num === 1) return 1;
    else return fib(num - 1) + fib(num - 2);
}

const fibAsync = asyncify(fib);

fibAsync(32, function (res) {
    console.log('2. The result is', res);
});

fibAsync(15, function (res) {
    console.log('2. The result is', res);
});
```

Or using promises:

```js
fibAsync(20).then(function (res) {
    console.log('The result is', res);
});

fibAsync(10).then(function (res) {
    console.log('The result is', res);
});
```

License
---
The MIT License (MIT)

Copyright (c) 2015 Maiah Macariola

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