1.1.1 • Published 3 years ago

holddotjs v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Hold.js 🚌🏃🏻‍♂️

When something feels right... Hold on to it! :) A Javascript module for waiting different amounts of time.

Getting Started

Install

npm install holddotjs

Import

const hold = require('holddotjs');

API Reference

Hold.js API makes it easy to wait for milliseconds, seconds, minutes and even hours.

async function makeBusLeave() {
    await hold.millisecs(5);    // -> 😭 Holds for 5ms
    await hold.seconds(30);     // -> 😞 Holds for 30s
    await hold.minutes(10);     // -> 😦 Holds for 10min
    await hold.hours(2);        // -> 😄 Holds for 2hrs

    console.log('🚌💨 leaving...');
}

Function Type Definitions

/**
 * @param ms The amount of milliseconds to wait.
 * @return A promise that gets resolved after a given amount of milliseconds.
 */
function millisecs(ms: number): Promise<void>;

/**
 * @param s The amount of seconds to wait.
 * @return A promise that gets resolved after a given amount of seconds.
 */
function seconds(s: number): Promise<void>;

/**
 * @param min The amount of minutes to wait.
 * @return A promise that gets resolved after a given amount of minutes.
 */
function minutes(min: number): Promise<void>;

/**
 * @param hr The amount of hours to wait.
 * @return A promise that gets resolved after a given amount of hours.
 */
function hours(hr: number): Promise<void>;

License

Hold.js is licensed under the MIT License.

1.1.1

3 years ago

1.1.0

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago