Skip to content

magicdawn/promise.sleep

Repository files navigation

promise.sleep

promise.sleep

Build Status Coverage Status npm version npm downloads npm license

Install

npm i promise.sleep --save

API

sleep

const sleep = require('promise.sleep');

sleep(100).then(function(){
  // blabla
});

sleep.Green

const Green = require('promise.sleep').Green;
const green = new Green({
  min: '1m',
  max: '10m',
  factor: '1m',
});
  • green.idle() sleep a while
  • green.busy() / green.reset() reset to min

Changelog

CHANGELOG.md

See Also

License

the MIT License http://magicdawn.mit-license.org