Skip to content

Commit

Permalink
Scaffold: Normalize project (closes #8, closes #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 27, 2016
1 parent f765d7c commit fd2ed9e
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 34 deletions.
24 changes: 22 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
language: node_js
node_js:
- "0.10"
- '0.10'
script:
- npm test
- npm run lint
74 changes: 51 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <blaine@iceddev.com> (http://iceddev.com/)",
"contributors": [
"Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",
"Pawel Kozlowski <pkozlowski.opensource@gmail.com>",
"Benjamin Tan <demoneaux@gmail.com> (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"
]
}
4 changes: 2 additions & 2 deletions test/parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ 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]);
done();
});
});

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);
Expand Down
4 changes: 2 additions & 2 deletions test/series.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ 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]);
done();
});
});

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);
Expand Down
4 changes: 2 additions & 2 deletions test/settleParallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ 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]);
done();
});
});

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);
Expand Down
4 changes: 2 additions & 2 deletions test/settleSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ 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]);
done();
});
});

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);
Expand Down

0 comments on commit fd2ed9e

Please sign in to comment.