Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including unquick with all npm packages installed. Try it out:

var unquick = require("unquick")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

unquick v0.0.4

Ensures that the function will be executed for at least the specified time

unquick

Ensures that the function will be executed for at least the specified time.

Build Status NPM version

FAQ

Q: Why not p-min-delay?

A: Because p-min-delay works with promise, not function.

Install

npm i unquick

Usage

const unquick = require('unquick');

const runForAtLeast1000ms = unquick(fn, delay);
  • fn - any sync or async function.
  • delay - number of milliseconds.

Returns async function, that takes same parameters as fn and do the same things, but do it at least delay milliseconds or longer.

License

MIT

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free