New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

drainpipe

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drainpipe

pipe a value through a chain of functions

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by140%
Maintainers
1
Weekly downloads
 
Created
Source

drainpipe

Build Status

pipe a value through a chain of functions

vv(23)
  (function(v) { return v * 2 })
  (function(v) { return v + 2 })
  (function(v) { console.log(v) })  // 48

install

node:

$ npm install drainpipe

browser:

$ bower install drainpipe
<script src="/bower_components/drainpipe/drainpipe.js"></script>

api

vv(x)

Takes in a value and starts a drainpipe chain.

vv(x)(fn[, arg1[, arg2[, ...]]])

Takes in a function and optional extra arguments, calls the function with the current value in the drainpipe chain and stores its result as the new value in the drainpipe chain.

function add(a, b) {
  return a + b
}


vv(23)
  (add, 1)
  (add, 3)
  (function(v) { console.log(v) })  // 27

vv(x)()

Returns the current value in the drainpipe chain

var x = vv(23)
  (function(v) { return v * 2 })
  (function(v) { return v + 2 })
  ()

console.log(x)  // 48

Keywords

FAQs

Package last updated on 03 Apr 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc