diff --git a/.travis.yml b/.travis.yml index 68b5c45..8c8bca5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,8 @@ language: nodejs nodejs: + - 0.10 + - 0.12 + - iojs-v1 + - iojs-v2 + - iojs-v3 - iojs diff --git a/README.md b/README.md new file mode 100644 index 0000000..0aa1773 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# Cron-cluster +Ensure that a cron is launched only for a node app when it was clustered + +## Install +```bash +npm install cron-cluster +``` + +## Usage +```js +var redis = require('redis').createClient() +var CronJob = require('cron-cluster')(redis).CronJob + +function doCron () { + var job = new CronJob('* * * * * *', function () { + // Do some stuff here + }) + job.start() +} +``` diff --git a/index.js b/index.js index fd2a7ac..28e02e5 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -require('./lib/cron-cluster') +module.exports = require('./lib/cron-cluster') diff --git a/package.json b/package.json index 5cdbca0..2b2c992 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "name": "cron-cluster", "version": "0.0.1", - "description": "A Cluster plugin for cron using redis", + "description": "A Cluster version of node-cron using redis", "main": "index.js", "directories": { "test": "test" }, "scripts": { - "test": "tap test/*.js | faucet" + "test": "standard {lib,test}/*.js && tape test/*.js | faucet", + "watch-test": "onchange 'lib/*.js' 'test/*.js' -- npm test" }, "author": "Andy Vanbutsele ", "license": "ISC", @@ -17,7 +18,11 @@ "redis-leader": "^0.1.0" }, "devDependencies": { + "async": "^1.4.2", "faucet": "0.0.1", - "tap": "^1.4.0" + "onchange": "^2.0.0", + "redis": "^1.0.0", + "standard": "^5.2.1", + "tape": "^4.2.0" } }