1.0.1 • Published 9 years ago

nu-sleep v1.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

nu-sleep

Asynchronous sleep for adding expected delays to code

npm version Dependency Status devDependency Status Known Vulnerabilities

Install

npm install nu-sleep

Example

const sleep = require('nu-sleep');

// Promises
function doSomething1 () {
    sleep(1000).then(function () {
        // Will be executed after 1000 ms.
    });
};

// ES7 async/await
async function doSomething2 () {
    await sleep(1000);
    // Eveything after here will be executed after 1000 ms.
};

License

MIT

1.0.1

9 years ago

1.0.0

9 years ago