Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prestaul/oft
A simple cron-like library for triggering tasks at regular intervals in node.
https://github.com/prestaul/oft
Last synced: about 18 hours ago
JSON representation
A simple cron-like library for triggering tasks at regular intervals in node.
- Host: GitHub
- URL: https://github.com/prestaul/oft
- Owner: Prestaul
- License: mit
- Created: 2014-01-17T23:18:38.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-21T21:35:27.000Z (almost 11 years ago)
- Last Synced: 2024-09-22T07:47:48.271Z (about 2 months ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
oft
===Oft is a simple cron-like library for triggering tasks are regular intervals.
Basic Usage
-----------Use `oft.atEvery` to execute a function at a regular interval:
```js
var oft = require('oft');oft.atEvery('5 seconds', function() { /* ... */ });
oft.atEvery('10 sec', function() { /* ... */ });
oft.atEvery('5 minutes', function() { /* ... */ });
oft.atEvery('15 mins', function() { /* ... */ });
oft.atEvery('1 hr', function() { /* ... */ });
oft.atEvery('12 hrs', function() { /* ... */ });
oft.atEvery('1 day', function() { /* ... */ });
oft.atEvery('1 day', function() { /* ... */ });
oft.atEvery('1 wk', function() { /* ... */ });
```Similar to cron, `oft.atEvery('5 s', func);` does not trigger *in* 5 seconds, it will first trigger in less than 5 seconds and then it triggers at even 5 second intervals.
For example, if set at 12:15:32 it will trigger at 12:15:35, 12:15:40, 12:15:45, 12:15:50, etc.