New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pipejs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pipejs

Node js pipeline library with fluid api

latest
Source
npmnpm
Version
1.0.12
Version published
Maintainers
1
Created
Source

PipeJS

PipeEach and Pipe

npm install pipejs

var Pipe = require('pipejs').Pipe;

var PipeEach = require('pipejs').PipeEach;

##Using Pipe

var Pipe = require('pipejs').Pipe;
var hooks = require('./hooks');
var data = {
    field: {
        "title": "Android Widget",
        "name": "watch",
    }
};

var pipeLine = new Pipe();
pipeline.props ={
    customDataToPass:'some data'
};
pipeLine
    .use(hooks.addArray)
    .use(hooks.addSomeText) 
    //OR
    .use(function(err, obj, next, props) {
        // Use 'porps.customDataToPass' in your handlers 
        if (err) {
            console.log(err);
            return;
        }
        obj.field.newField = 'new field added';
        next();
    })
    .run(data)
    .done(function(errors, data, props){
        //errors - Array of errors
        //data - your modified data
        //props - your props (Can be ued for mutated data result or gouping)
    });

##Using PipeEach

var PipeEach = require('pipejs').PipeEach;
var hooks = require('./hooks');
var data = [{
    data: {
        "title": "Android Widget",
        "name": "watch",
    }
}, {
    data: {
        "title": "iPhone Widget",
        "name": "watch",
    }
}];
var iterator = new PipeEach();
pipeline.props ={
    customDataToPass:'some data'
};
iterator
    .use(hooks.addArray)
    .use(hooks.addSomeText) 
    //OR
    .use(function(err, obj, next, props) { 
         // Use 'porps.customDataToPass' in your handlers
        if (err) {
            console.log(err);
            return;
        }
        obj.data.newField = 'new field added';
        next();
    })
    .run(data)
    .done(function(errors, data, props) {
        //errors - Array of errors
        //data - your modified data
        //props - your props (Can be ued for mutated data result or gouping)
        console.log('Errors', errors);
        console.log('Data', data);
    });
    

FAQs

Package last updated on 02 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts