do-pipeline
TypeScript icon, indicating that this package has built-in type declarations

0.0.16 • Public • Published

do-pipeline · GitHub license npm version

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 bluebird friendly
  • 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-pipeline

Usage

// 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)); 
 
// FOOD
 

For more example, just take a look at the unit test file !

Have fun 😄

Package Sidebar

Install

npm i do-pipeline

Weekly Downloads

0

Version

0.0.16

License

MIT

Unpacked Size

10.4 kB

Total Files

10

Last publish

Collaborators

  • davidroman