Socket
Socket
Sign inDemoInstall

sancronos-validator

Package Overview
Dependencies
3
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sancronos-validator

Cron expression validator


Version published
Weekly downloads
111
decreased by-5.93%
Maintainers
1
Install size
770 kB
Created
Weekly downloads
 

Readme

Source

sancronos-validator

NPM Version NPM Downloads Build Status bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies bitHound Code Codacy Badge Code Climate Issue Count

About

Cron expression validator

NPM

Settings

Install sancronos-validator

$ npm install sancronos-validator

Use

Accepts clasic crontab

  x    x    x    x    x
  ┬    ┬    ┬    ┬    ┬
  │    │    │    │    │
  │    │    │    │    │
  │    │    │    │    └───── day of week (0 - 7, - * /) (0 or 7 is sunday)
  │    │    │    └────────── month (1 - 12 , - * /)
  │    │    └─────────────── day of month (1 - 31 , - * /)
  │    └──────────────────── hour (0 - 23 , - * /)
  └───────────────────────── minutes (0 - 59 , - * /)

Accepts extended crontab

  x    x    x    x    x    x    x
  ┬    ┬    ┬    ┬    ┬    ┬    ┬
  │    │    │    │    │    │    │
  │    │    │    │    │    │    └ year (1900 - 3000 , - * /) optional
  │    │    │    │    │    └───── day of week (0 - 7 , - * / L #) (0 or 7 is sunday)
  │    │    │    │    └────────── month (1 - 12 , - * /)
  │    │    │    └─────────────── day of month (1 - 31 , - * / L W)
  │    │    └──────────────────── hour (0 - 23 , - * /)
  │    └───────────────────────── minutes (0 - 59 , - * /)
  └────────────────────────────── seconds (0 - 59 , - * /) optional

But... who can use sancronos-validator?

Answer: Everyone!

For Promise lovers

const sancronos = require("sancronos-validator");
//..
sancronos.isValid("* * * * *")
.then(function(crontab) {
  //.. do something
})
.catch(function(err) {
  // handle error
});

For callback lovers

const sancronos = require("sancronos-validator");
//..
sancronos.isValid("* * * * *", (err, crontab) => {
  if(err){
    //Oops I did it again!
  }
  //Do something with your newly validated crontab
});

For sync lovers

const sancronos = require("sancronos-validator");
//..
let crontab = sancronos.isValid("* * * * *", true);
//Do something with your crontab
//Be aware that in case it's invalid, it will throw an error.

See test/ for more details.

Changelog

1.2.0 (18-07-2017)

  • Added callbacks
  • Added sync

1.0.1 (11-07-2017)

  • README with examples.

1.0.0 (11-07-2017)

Start

Keywords

FAQs

Last updated on 18 Jul 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc