0.0.16 โข Published 7 years ago
do-pipeline v0.0.16
do-pipeline ยท

do-pipeline is a minimalist pipeline library for your data workflows.
- Put your params first then let's chain your functions
- Promise based: it's
bluebirdfriendly - Pipelineception: you can put pipelines into a pipeline and so on!
- So simple it works everywhere and it's way more easier to read!
By using it, it feels like to go from programmer to scenarist!
Thank you for using this small piece of code in your projects ๐
Install it
npm i --save do-pipelineUsage
// with import
import Pipeline from 'do-pipeline';
// with require
const Pipeline = require('do-pipeline');Simple usage :
const Pipeline = require("do-pipeline");
const Promise = require("bluebird");
const capitalize = str => str[0].toUpperCase() + str.substring(1);
const splitOnSpaces = str => str.trim().split(" ");
const getLastOfArr = arr => arr.pop();
const toUpper = values => values.toUpperCase();
const wait = async values => {
await Promise.delay(500);
return values;
};
Pipeline([
"love food",
capitalize,
wait,
splitOnSpaces,
getLastOfArr,
toUpper
])
.then(data => console.log(data));
// FOODFor more example, just take a look at the unit test file !
Have fun ๐