Socket
Book a DemoInstallSign in
Socket

@nkp/delay

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nkp/delay

Utility function to resolve a promise after the given duration.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

@nkp/delay

npm version deploy status known vulnerabilities

Zero-dependency utility function to resolve a promise after the given duration.

import { delay } from '@nkp/delay';
import { performance } from 'perf_hooks';

function run() {
  const start = performance.now();

  // wait for 2ms before continuing
  await delay(2_500);

  const end = performance.now();

  console.log(`took: ${end - start}ms`);
}

run();

Table of contents

Exports

@nkp/delay exports both CommonJS and ES modules.

Installation

npm

npm install @nkp/delay

yarn

yarn add @nkp/delay

pnpm

pnpm add @nkp/delay

Publishing

To a release a new version:

  • Update the version number in package.json
  • Push the new version to the master branch on GitHub
  • Create a new release on GitHub for the latest version

This will trigger a GitHub action that tests and publishes the npm package.

Keywords

TypeScript

FAQs

Package last updated on 08 Feb 2022

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