Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation in README.md file
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,58 @@ | ||
# cron-runner | ||
Custom code execution periodically | ||
|
||
[![NPM](https://nodei.co/npm/cron-runner.png)](https://nodei.co/npm/cron-runner/) | ||
|
||
[![Coveralls branch](https://img.shields.io/coveralls/bem-site/cron-runner/master.svg)](https://coveralls.io/r/bem-site/cron-runner?branch=master) | ||
[![Travis](https://img.shields.io/travis/bem-site/cron-runner.svg)](https://travis-ci.org/bem-site/cron-runner) | ||
[![David](https://img.shields.io/david/bem-site/cron-runner.svg)](https://david-dm.org/bem-site/cron-runner) | ||
[![David](https://img.shields.io/david/dev/bem-site/cron-runner.svg)](https://david-dm.org/bem-site/cron-runner#info=devDependencies) | ||
|
||
|
||
## Usage | ||
|
||
You should inherit from given module with help of [inherit](https://www.npmjs.com/package/inherit) | ||
|
||
``` | ||
var inherit = require('inherit'), | ||
CronRunner = require('cron-runner'); | ||
var MyCronRunner = inherit(CronRunner, { | ||
__constructor: function (options) { | ||
this.__base(options); | ||
//TODO implement your custom initialization code here | ||
}, | ||
execute: function () { | ||
//TODO implement your custom execution code here | ||
} | ||
}); | ||
var mcr = new MyCronRunner({ | ||
cron: { | ||
pattern: '0 */1 * * * *' | ||
} | ||
}); | ||
mcr.start(); | ||
``` | ||
|
||
## Testing | ||
|
||
Run tests: | ||
``` | ||
npm run mocha | ||
``` | ||
|
||
Run tests with istanbul coverage calculation: | ||
``` | ||
npm run istanbul | ||
``` | ||
|
||
Run codestyle verification (jshint and jscs) | ||
``` | ||
npm run codestyle | ||
``` | ||
|
||
Maintainer @tormozz48 | ||
Please send your questions and proposals to: tormozz48@gmail.com |