Socket
Book a DemoInstallSign in
Socket

pancho

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

pancho

Your applications also deserve a nap.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

pancho

Greenkeeper badge Build Status Downloads

Your applications also deserve a nap.

Install

npm i pancho

Use

pancho returns a promise, making it easy to control your program's flow after "waking up".
pancho takes arguments in the form of:

  • pancho(int) - Sleep for int seconds,
  • pancho(int, int) - Sleep for a random amount of seconds, defined by (min, max),
  • pancho('natural language') - Sleep for the specified time.
const nap = require('pancho');

nap(1).then(duration => {
    // Your program slept for 1 second.
    // duration = Duration of the nap, in milliseconds.
});

nap(1, 3).then(duration => {
    // Your program slept for a random amount of seconds (between 1 and 3).
    // duration = Duration of the nap, in milliseconds.
});

nap('3.5 seconds').then(duration => {
    // Your program slept for 3.5 seconds.
    // duration = Duration of the nap, in milliseconds.
});

nap('5 minutes').then(duration => {
    // Your program slept for 5 minutes.
    // duration = Duration of the nap, in milliseconds.
});

Contribute

fork https://github.com/aichholzer/pancho/

License

MIT

Keywords

sleep

FAQs

Package last updated on 22 Jun 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