Socket
Socket
Sign inDemoInstall

pull-pushable

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-pushable

pull-stream with a push interface


Version published
Weekly downloads
36K
increased by1.23%
Maintainers
1
Weekly downloads
 
Created
Source

pull-pushable

A pull-stream with a pushable interface.

Example

var pushable = require('pull-pushable')
var pull     = require('pull-stream')

pushable.push(1)

pushable.pipe(pull.drain(console.log))

## Example 2

Create a false source stream with a `.push(data, cb?)`
property. Use when you really need a push api,
or need to adapt pull-stream to some other push api.

``` js
function ls (dir) {
  var ps = pull.pushable()
  fs.readdir(dir, function (err, ls) {
    if(err) return ps.end(err)
    ls.forEach(function (file) {
      ps.push(path.resolve(dir, file))
    })
    ps.end()
  })
  return ps
}


## License

MIT

FAQs

Package last updated on 22 Nov 2013

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