process.nexttick

1.0.1 • Public • Published

view on npm downloads per month node version build status test coverage license

In Node version <1 process.nextTick() accepts a callback function only. In later versions you can supply additional arguments to pass when invoking the callback. This is a polyfill for early versions.

Usage

 
// In Node >=1 the built-in `nextTick()` method is exposed, 
// so this is just a re-assignment that has no effect.
process.nextTick = require('process.nexttick')
 
// Now you can safely pass additional arguments 
// to `nextTick()` regardless of Node version.
process.nextTick(function (arg) {
    arg === 42 // true
}, 42)
 

Note: This module itself does not overwrite process.nextTick().

Installation

With npm:

npm install process.nexttick

License

MIT

Package Sidebar

Install

npm i process.nexttick

Weekly Downloads

6

Version

1.0.1

License

MIT

Last publish

Collaborators

  • schwarzkopfb