npm

Join us for the "JavaScript Supply Chain Security" tech talk, presented by VP of Security, Adam Baldwin. 6/20 at 10am PT.Sign up here »

p-immediate

3.1.0 • Public • Published

p-immediate Build Status

Returns a promise resolved in the next event loop - think setImmediate()

Promises are by default resolved in a microtask (current event loop).

Install

$ npm install p-immediate

Usage

const pImmediate = require('p-immediate');
 
(async () => {
    await pImmediate();
 
    // Executed in the next event loop
    console.log('🦄');
})();

Related

  • delay - Delay a promise a specified amount of time
  • p-min-delay - Delay a promise a minimum amount of time
  • p-timeout - Timeout a promise after a specified amount of time
  • More…

License

MIT © Sindre Sorhus

install

npm i p-immediate

Downloadsweekly downloads

228

version

3.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability