Skip to content

Commit

Permalink
docs(README): Updated README with simple usage instructions
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
blinkylights23 committed May 15, 2017
1 parent 8503ce9 commit 32a77f0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"env",
{
"targets": {
"browsers": [
"last 2 versions",
"ie >= 10"
]
"browsers": [ "last 2 versions", "ie >= 10" ]
}
}
]
Expand Down
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
# cronmatch

`cronmatch` is a simple cron expression parser. It compares a provided date string or `Date` object with a cron expression to see if it matches.
`Cronmatch` is a simple cron expression parser. It compares a provided date string or `Date` object with a cron expression to see if it matches.

## Installation

For use in Node:
```
npm install cronmatch
npm install @paulsmith/cronmatch
```

For use in the browser:
```
<script src="https://unpkg.com/@paulsmith/cronmatch/dist/cronmatch.min.js"></script>
```

## Usage
## Usage

```
const cronmatch = require('cronmatch');
var cronExpr = '*/2 * * * *'; // Every even minute
var date1 = new Date('January 20, 2020 12:00:00');
var date2 = new Date('January 20, 2020 12:01:00');
cronmatch(cronExpr, date1); // true
cronmatch(cronExpr, date2); // false
```

minute: [0, 59]
hour: [0, 23]
day: [1, 31]
month: [1, 12]
dayOfWeek: [0, 6]



## Limitations

* `cronmatch` does not yet understand 6-field cron expressions with seconds
* It does not yet validate cron expressions
* Does not yet support JAN-DEC for month or MON-SUN for dayOfWeek
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import getRange from './getRange';


// const stepInterval = (expr) => {
// };

const fieldHit = (field) => {
var range, step;
var values = [];
Expand Down

0 comments on commit 32a77f0

Please sign in to comment.