New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@timsuchanek/sleep-promise

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@timsuchanek/sleep-promise

Resolves a promise after a specified delay.

  • 8.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
109K
decreased by-15.25%
Maintainers
1
Weekly downloads
 
Created

What is @timsuchanek/sleep-promise?

The @timsuchanek/sleep-promise package is a simple utility that allows you to pause the execution of asynchronous code for a specified amount of time. It is useful for introducing delays in your code, such as waiting for a certain condition to be met or throttling requests.

What are @timsuchanek/sleep-promise's main functionalities?

Basic Sleep Functionality

This feature allows you to pause the execution of your code for a specified duration. In the example, the code logs 'Start', waits for 2 seconds, and then logs 'End'.

const sleep = require('@timsuchanek/sleep-promise');

async function example() {
  console.log('Start');
  await sleep(2000); // Sleep for 2 seconds
  console.log('End');
}

example();

Other packages similar to @timsuchanek/sleep-promise

Keywords

FAQs

Package last updated on 11 Sep 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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc