You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

next-tick

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-tick

Environment agnostic nextTick polyfill


Version published
Weekly downloads
9.5M
decreased by-2.26%
Maintainers
1
Created
Weekly downloads
 

Package description

What is next-tick?

The next-tick npm package is designed to defer the execution of a function until the next tick of the event loop. This can be particularly useful for breaking up long-running tasks or for ensuring that code execution happens after the current call stack has cleared. It provides a simple and efficient way to schedule tasks to run asynchronously.

What are next-tick's main functionalities?

Scheduling a function to run on the next tick

This feature allows you to schedule a function to be executed as soon as possible in the next tick of the event loop, without waiting for the current call stack to complete. It's useful for deferring execution to ensure non-blocking operations.

const nextTick = require('next-tick');
nextTick(() => {
  console.log('This will run on the next tick.');
});

Other packages similar to next-tick

Changelog

Source

1.1.0 (2020-02-11)

Features

  • Add support for queueMicrotask (Closes #13) (471986e)

Changelog for previous versions

See CHANGES file

Readme

Source

next-tick

Environment agnostic nextTick polyfill

To be used in environment agnostic modules that need nextTick functionality.

  • When run in Node.js process.nextTick is used
  • In modern engines, microtask resolution is guaranteed by queueMicrotask
  • In older browsers, MutationObserver is used as a fallback
  • In other engines setImmediate or setTimeout(fn, 0) is used as fallback.
  • If none of the above is supported module resolves to null

Installation

NPM

In your project path:

$ npm install next-tick
Browser

To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: Browserify, Webmake or Webpack

Tests Build Status

$ npm test

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.


Get professional support for d with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Package last updated on 11 Feb 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc