https://github.com/shime/repeat-time
Declarative setInterval
https://github.com/shime/repeat-time
Last synced: 9 months ago
JSON representation
Declarative setInterval
- Host: GitHub
- URL: https://github.com/shime/repeat-time
- Owner: shime
- Created: 2014-09-05T15:25:33.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-05T15:28:24.000Z (almost 12 years ago)
- Last Synced: 2024-12-27T15:26:29.533Z (over 1 year ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## repeat-time
[](https://travis-ci.org/shime/repeat-time)
Declarative setInterval based on [english-time](http://github.com/azer/english-time).
Basically a `s/setTimeout/setInterval/g` of [after-time](http://github.com/azer/after-time).
```js
repeat = require('repeat-time')
repeat('150ms', function(){
console.log('yo!')
})
repeat('5 minutes', function(){
console.log('hello!')
})
repeat('3 Hours, 15 Minutes and 20 Milliseconds', function(){
console.log('yo!')
})
repeat('3h 15m 20ms', 'foo', 'bar', function(foo, bar){
foo // => 'foo'
bar // => 'bar'
})
```
## Install
```bash
$ npm install repeat-time
```
## License
MIT