https://github.com/mapleincode/repeat-task
https://github.com/mapleincode/repeat-task
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mapleincode/repeat-task
- Owner: mapleincode
- Created: 2017-01-11T06:26:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-28T10:36:09.000Z (over 4 years ago)
- Last Synced: 2024-04-16T06:21:34.960Z (about 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# repeat-task
a simple tool to run the repeat tasks;## Explain
a simple tool to run the repeat tasks;
## Usage
```javascript
const Task = require('repeat-task');const t = new Task();
// add tasks
t.addTask('TaskName1', task1, taskIntervalTime1, {
timing: true
});
t.addTask('TaskName2', task2, taskIntervalTime2, {
timing: true
});// run
t.run();// listen log
t.on('log', function(log) {
console.log(log);
});//listen error
t.on('error', function(err) {
console.error(err);
});```