diff --git a/.jshintrc b/.jshintrc index 22e3901..8ae1f73 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,5 +1,25 @@ { - "node": true, + "bitwise": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "forin": true, + "freeze": true, + "indent": 2, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "quotmark": "single", + "undef": true, "strict": true, - "eqnull": true + "maxparams": 4, + "maxdepth": 3, + "maxstatements": 50, + "maxlen": 100, + + "eqnull": true, + "globalstrict": true, + + "node": true } diff --git a/.travis.yml b/.travis.yml index 6e5919d..95f74e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ language: node_js node_js: - - "0.10" + - '0.10' +script: + - npm test + - npm run lint diff --git a/package.json b/package.json index 4653b75..cebac0a 100644 --- a/package.json +++ b/package.json @@ -2,36 +2,64 @@ "name": "bach", "version": "0.3.0", "description": "Compose your async functions with elegance", - "main": "index.js", - "directories": { - "test": "test" - }, - "scripts": { - "test": "lab -cv" - }, - "repository": { - "type": "git", - "url": "git://github.com/phated/bach" - }, - "keywords": [ - "async", - "compose", - "fluent", - "composing" - ], "author": "Blaine Bublitz (http://iceddev.com/)", + "contributors": [ + "Blaine Bublitz (http://iceddev.com/)", + "Pawel Kozlowski ", + "Benjamin Tan (https://d10.github.io/)" + ], + "repository": "phated/bach", "license": "MIT", - "bugs": { - "url": "https://github.com/phated/bach/issues" + "engines": { + "node": ">= 0.10" }, - "homepage": "https://github.com/phated/bach", - "devDependencies": { - "lab": "^4.1.0" + "main": "index.js", + "files": [ + "index.js", + "lib", + "LICENSE" + ], + "scripts": { + "test": "lab -cv", + "lint": "jshint test lib index.js --reporter node_modules/jshint-stylish/stylish.js --exclude node_modules" }, "dependencies": { "async-done": "~0.4.0", "async-settle": "~0.2.0", "lodash": "~2.4.1", "now-and-later": "0.0.5" - } + }, + "devDependencies": { + "jshint": "^2.5.5", + "jshint-stylish": "^0.4.0", + "lab": "^4.1.0" + }, + "keywords": [ + "compose", + "fluent", + "composing", + "continuation", + "function composition", + "functional", + "async", + "map", + "series", + "parallel", + "extension", + "tracing", + "debug", + "timing", + "aop", + "settle", + "promises", + "callbacks", + "observables", + "streams", + "end", + "completion", + "complete", + "finish", + "done", + "error handling" + ] } diff --git a/test/parallel.js b/test/parallel.js index d2a7c76..59f7094 100644 --- a/test/parallel.js +++ b/test/parallel.js @@ -31,7 +31,7 @@ function fnError(done){ describe('parallel', function(){ - it('should execute functions in parallel and call callback with results on completion', function(done){ + it('should execute functions in parallel, passing results', function(done){ bach.parallel(fn1, fn2, fn3)(function(error, results){ expect(error).to.equal(null); expect(results).to.deep.equal([1, 2, 3]); @@ -39,7 +39,7 @@ describe('parallel', function(){ }); }); - it('should execute functions in parallel and call callback with error on an error', function(done){ + it('should execute functions in parallel, passing error', function(done){ function slowFn(done){ setTimeout(function(){ expect('slow function should not be called').to.equal(undefined); diff --git a/test/series.js b/test/series.js index 0b0e1bb..bdc8df9 100644 --- a/test/series.js +++ b/test/series.js @@ -31,7 +31,7 @@ function fnError(done){ describe('series', function(){ - it('should execute functions in series and call callback with results on completion', function(done){ + it('should execute functions in series, passing results', function(done){ bach.series(fn1, fn2, fn3)(function(error, results){ expect(error).to.equal(null); expect(results).to.deep.equal([1, 2, 3]); @@ -39,7 +39,7 @@ describe('series', function(){ }); }); - it('should execute functions in series and call callback with error on an error', function(done){ + it('should execute functions in series, passing error', function(done){ function slowFn(done){ setTimeout(function(){ done(null, 2); diff --git a/test/settleParallel.js b/test/settleParallel.js index 4083fed..35c9589 100644 --- a/test/settleParallel.js +++ b/test/settleParallel.js @@ -31,7 +31,7 @@ function fnError(done){ describe('settleParallel', function(){ - it('should execute functions in parallel and call callback with results on settled', function(done){ + it('should execute functions in parallel, passing settled results', function(done){ bach.settleParallel(fn1, fn2, fn3)(function(errors, results){ expect(errors).to.equal(null); expect(results).to.deep.equal([1, 2, 3]); @@ -39,7 +39,7 @@ describe('settleParallel', function(){ }); }); - it('should execute functions in parallel and call callback with errors on settled', function(done){ + it('should execute functions in parallel, passing settled errors and results', function(done){ function slowFn(done){ setTimeout(function(){ done(null, 2); diff --git a/test/settleSeries.js b/test/settleSeries.js index 8e5920b..b0ece22 100644 --- a/test/settleSeries.js +++ b/test/settleSeries.js @@ -31,7 +31,7 @@ function fnError(done){ describe('settleSeries', function(){ - it('should execute functions in series and call callback with results on settled', function(done){ + it('should execute functions in series, passing settled results', function(done){ bach.settleSeries(fn1, fn2, fn3)(function(errors, results){ expect(errors).to.equal(null); expect(results).to.deep.equal([1, 2, 3]); @@ -39,7 +39,7 @@ describe('settleSeries', function(){ }); }); - it('should execute functions in series and call callback with errors on settled', function(done){ + it('should execute functions in series, passing settled errors and results', function(done){ function slowFn(done){ setTimeout(function(){ done(null, 2);