Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettycron

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettycron

Display cron runspecs in human-readable format

  • 0.9.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by42.43%
Maintainers
1
Weekly downloads
 
Created
Source

prettyCron

prettyCron is a simple JavaScript deuglifier for cron schedules: it prints out a human-readable interpretation of when the schedule will run.

Perhaps you'd like to check out the examples!

Installation - browser

Include prettycron.js after adding moment.js and later.js (only later-cron.js is required).

<script src="moment.min.js" type="text/javascript"></script>
<script src="later-cron.min.js" type="text/javascript"></script>
<script src="prettycron.js" type="text/javascript"></script>

Installation - Node

Simply use npm and require:

$ npm install prettycron
var prettyCron = require('prettycron');

Usage

prettyCron exposes two methods, both of which take a cron specification as the only argument.

prettyCron.toString(cron)

Returns a human-readable sentence describing all the times this cron will run.

prettyCron.toString("37 10 * * * *");
// returns "10:37 every day"
prettyCron.getNext(cron)

Returns a string representing the next time this cron will run, formatted with moment's calendar() method.

prettyCron.getNext("0 * * * *");
// if current time is 4:45pm, then returns "Today at 5:00 PM"

Credits

prettyCron was originally written by dunse and posted to gist. It's licensed under LGPLv3.

prettyCron depends on:

FAQs

Package last updated on 10 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc