Skip to content

A simple module that helps you to manage asynchronous operations in Node.js

License

Notifications You must be signed in to change notification settings

walen007/flowmaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple NPM module that helps you to manage asyncronous operations and avoid callback hell, code smell or spaghetti code.

To install:

sudo npm install flowmaster

To run a test, please install the dependencies as follows:

sudo npm install
sudo npm install -g mocha

Run the "mocha" command to test the module.

mocha

NB: You must have MongoDB running locally. The test wasn't configured to use MongoDB connection authentication. You can add authentication on line 115 of FlowMasterSpec.js, the test file can be found inside the "test" folder.

Although this module's test uses MongoDB database asyncronous operations, the module does not have to be used to manage only async db ops. You can use it to manage any type of asyncronous operations in Node.js.

If any functions supplied to the FlowMaster.series() returns an error, the entire operation is aborted.

Ensure that your functions return acceptable callback formats when using FlowMaster.series().

Callback format for failed operations:

callback(err, {status: 'failed', message: 'YOUR_ERROR_MESSAGE'});

Callback format for successful operations:

callback(null, {status: 'success', message: 'YOUR_SUCCESS_MESSAGE', data: yourResponseData});

More examples can be found in the test file: /test/FlowMasterSpec.js

About

A simple module that helps you to manage asynchronous operations in Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages