@tiaanduplessis/nap
v1.0.0
Published
Unfancy promise based sleep function
Downloads
24
Maintainers
Readme
Install
$ npm install @tiaanduplessis/nap
# OR
$ yarn add @tiaanduplessis/nap
Usage
import nap from '@tiaanduplessis/nap'
nap().then(() => console.log('Took a 1 sec nap'))
nap(3000).then(() => console.log('Took a 3 sec nap'))
nap(5000).then(() => console.log('Took a 5 sec nap'))
async function doThings () {
await nap(4000)
console.log('Took a 4 sec nap')
}
doThings()
// Took a 1 sec nap
// Took a 3 sec nap
// Took a 4 sec nap
// Took a 5 sec nap
Contributing
Contributions are welcome!
- Fork it.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Or open up a issue.
License
Licensed under the MIT License.