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

pdelay

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdelay

Returns a Promise that resolves with a given value after a set amount of time

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

pdelay

GitHub license npm version CircleCI Status Greenkeeper badge

pdelay(time, value)

This function returns a promise that resolves with a given value (optional) after a set amount of time (in milliseconds).

import pdelay from 'pdelay';

async function doStuff() {
  console.log('about to wait one second...');
  await pdelay(1000);
  console.log('done waiting');
}

pdelay(2000, 'two seconds later').then(value => {
  console.log('got value', value);
});

The value parameter may be omitted, and the Promise will resolve to undefined.

Types

Both TypeScript and Flow type definitions for this module are included! The type definitions won't require any configuration to use.

Keywords

promise

FAQs

Package last updated on 04 Sep 2018

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