Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@lukaspolak/sleep

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

@lukaspolak/sleep

Resolve a promise after specified timeout

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
12
Maintainers
1
Weekly downloads
 
Created
Source

sleep

checks-status workflow/status codecov npm bundle size npm

Resolve a promise after specified timeout

Demo

CodeSandbox

Getting started

To use this package, you only need to install this dependency, import it and invoke the sleep function, e.g.:

import { sleep } from '@lukaspolak/sleep'

// async/await syntax
const asyncFn = async () => {
  await sleep(500) // Promise will be resolved in 500ms

  //...
}

// then syntax
sleep(500).then(() => {
  // ...
})

Install

npm install @lukaspolak/sleep

or

yarn add @lukaspolak/sleep

Contributing

Please read the Contribution guidelines to start with your awesome contributions!

Why the library is prefixed with @lukaspolak/

There are a lot of similar libraries/packages on GitHub and npm, that can do the same. I wanted to enhance my programming skills, and I didn't want to find a unique name for the package.

Keywords

sleep

FAQs

Package last updated on 13 Feb 2021

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