https://github.com/jongha/cron-js
Cron is a time-based job scheduler in Linux. cron-js is daemon to execute scheduled commands using JavaScript on your webpage. The script depends on the local time of the operating system. Because it is running based on the web browser which running on client side. This script can make easier and more flexible development than server side script.
https://github.com/jongha/cron-js
cron cron-js javascript minutes webpage
Last synced: over 1 year ago
JSON representation
Cron is a time-based job scheduler in Linux. cron-js is daemon to execute scheduled commands using JavaScript on your webpage. The script depends on the local time of the operating system. Because it is running based on the web browser which running on client side. This script can make easier and more flexible development than server side script.
- Host: GitHub
- URL: https://github.com/jongha/cron-js
- Owner: jongha
- License: mit
- Created: 2014-04-22T07:42:46.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-04T12:52:41.000Z (about 12 years ago)
- Last Synced: 2025-03-24T07:59:12.455Z (over 1 year ago)
- Topics: cron, cron-js, javascript, minutes, webpage
- Language: JavaScript
- Homepage:
- Size: 230 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cron-js
Cron is a time-based job scheduler in Linux. cron-js is daemon to execute scheduled commands using JavaScript on your webpage. The script depends on the local time of the operating system. Because it is running based on the web browser which running on client side. This script can make easier and more flexible development than server side script.
## Description
```
cron.add([date], [exec]);
```
* date
* The time and date fields are
* minute: 0-59
* hour: 0-23
* day of month: 1-31
* month: 1-12
* day of week: 0-7 (0 is Sunday)
* exec
* url or function
## Examples
```
cron.add("`Minute` `Hour` `Day of month` `Month` `Day of week`", `Exec`);
cron.start(); // start cron
cron.stop(); // stop cron
```
## Usage
### For every minute
```
cron.add("* * * * *", function() { console.log("exec"); });
cron.start();
```
### For every 5 minute
```
cron.add("*/5 * * * *", function() { console.log("exec"); });
cron.start();
```
### For every 5 minute and Sunday
```
cron.add("*/5 * * * 0", function() { console.log("exec"); });
cron.start();
```
### For every minute URL call
```
cron.add("* * * * *", "http://[YOURURL]");
cron.start();
```
## License
cron-js is available under the terms of the MIT License.