fastzalgo

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i fastzalgo

Weekly Downloads

17

Version

1.0.0

License

MIT

Last publish

Collaborators

  • matteo.collina