Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcollina/fastzalgo
Dezalgo at top speed
https://github.com/mcollina/fastzalgo
Last synced: 2 months ago
JSON representation
Dezalgo at top speed
- Host: GitHub
- URL: https://github.com/mcollina/fastzalgo
- Owner: mcollina
- License: mit
- Created: 2016-09-01T13:17:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-01T14:03:10.000Z (over 8 years ago)
- Last Synced: 2024-10-06T01:48:03.494Z (3 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastzalgo
Makes a function asynchronous by wrapping it inside `process.nexTick`.
Similar to [dezalgo][dezalgo] but almost 3 times faster:```
runDezalgo*10000000: 7553ms
runFastzalgo*10000000: 2845ms
```The main difference from [dezalgo][dezalgo] is that **you must call the callback only once**.
## Usage
```js
'use strict'const zalgo = require('.')
const print = console.log
const asyncPrint = zalgo(console.log)asyncPrint('this happens after')
print('this happens before')// Prints:
//
// this happens before
// this happens after
```## Install
```js
npm i fastzalgo -g
```## License
MIT
[dezalgo]: http://npm.im/dezalgo