New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nexttick-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nexttick-polyfill

process.nextTick() polyfill

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

nextTick polyfill

  • Node.js use process.nextTick()
  • Browser :
    • MutationObserver ? MutaionObserver :
    • Promise ? Promise.resolve().then :
    • setImmediate ? setImmediate :
    • setTimeout

Usage

npm i nexttick-polyfill;

nexttick-polyfill(fn);

Understanding process.nextTick()

nextTick的兼容包

  • Node端: 直接使用process.nextTick()
  • 浏览器端:
    • 支持MutaionObser事件则使用,否则
    • 支持Promise则使用Promise.resolve().then,否则
    • 支持setImmediate则使用,否则
    • 使用setTimeout

使用

npm i nexttick-polyfill;

nexttick-polyfill(fn);

setTimeout和setImmediate以及process.nextTick的区别

Keywords

nextTick

FAQs

Package last updated on 13 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts