0.0.2 • Published 9 years ago

crontrans v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
9 years ago

Build Status

Crontrans

Translate cron expression into natural language.

Support format

*    *    *    *    *    
┬    ┬    ┬    ┬    ┬ 
│    │    │    │    │    
│    │    │    │    │    
│    │    │    │    └───── day of week (0 - 6) (0 is Sun)
│    │    │    └────────── month (1 - 12)
│    │    └─────────────── day of month (1 - 31)
│    └──────────────────── hour (0 - 23)
└───────────────────────── minute (0 - 59)

Setup

Node

  npm install crontrans

Useage:

  var crontrans = require('crontrans');

Browser

add this to head

Just insert the script tag into HTML page:

  <script src="../lib/crontrans.js"></script>

Useage:

  var crontrans = new CronTrans();

Example

	var message = crontrans.translate("0 11 4 * mon-wed");
	/*
		min: 0
		hour: 11
		day: 4
		month: any
		weekday: Mon,Tue,Wed	
	*/

	message = crontrans.translate("*/15 8-16,3 * * *");
	/*
		min: 0,15,30,45
		hour: 8,9,10,11,12,13,14,15,16,3
		day: any
		month: any
		weekday: any
	*/

LICENSE

MIT