Skip to content

rainder/human-to-cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HumanToCron

var humanToCron = require('human-to-cron');

humanToCron('once each minute') // => 0 */1 * * * *
humanToCron('each 2 minutes') // => * */2 * * * *
humanToCron('each second') // => */1 * * * * *
humanToCron('once each hour') // => 0 0 */1 * * *
humanToCron('once each day') // => 0 0 0 */1 * *
humanToCron('once each month') // => 0 0 0 0 */1 *
humanToCron('once each 5 months') // => 0 0 0 0 */5 *
humanToCron('midnight') // => 0 0 0 * * *
humanToCron('midnight each 2 minutes') // => 0 */2 0 * * *
humanToCron('once tuesday each 10 minutes') // => 0 */10 * 1 * *
humanToCron('friday 15:44') // => 0 44 15 4 * *
humanToCron('august friday 15:44') // => 0 44 15 4 7 *

Command line utility

$ npm i -g human-to-cron
$ human-to-cron "once each 5 months"

See tests for full list of expressions

About

Converts human readable expression to a cron string

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •