1.0.0 • Published 8 years ago

fastzalgo v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

fastzalgo

Makes a function asynchronous by wrapping it inside process.nexTick. Similar to dezalgo but almost 3 times faster:

runDezalgo*10000000: 7553ms
runFastzalgo*10000000: 2845ms

The main difference from dezalgo is that you must call the callback only once.

Usage

'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

npm i fastzalgo -g

License

MIT