Socket
Socket
Sign inDemoInstall

pull-live

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-live

construct a pull-stream for reading from a writable source, can read old records, new (live) records, or both.


Version published
Weekly downloads
28K
increased by5.07%
Maintainers
1
Weekly downloads
 
Created
Source

pull-live

construct a pull-stream for reading from a writable source, can read old records, new (live) records, or both.

to be used by pull-level, multiblobs, and secure-scuttlebutt. pull-live is generic, and easy to adapt to a new case.

api: createLive(createSource(opts), createLive(opts)) => createLiveStream(opts)

createLive takes two functions, createSource (which returns a source stream of the stored data) and createLive which returns a stream of the live data. A function that takes opts and is returned.

if opts.live is set to true, the stream will only read the old data (from createSource) and then the new data (from createLive) with one item {sync: true} to mark when the old data has finished.

If opts.sync === false then the sync item will dropped.

if opts.live is true (default: false) the live data is included. if opts.old is false (default: true) the output will not include the old data. If live and old are both false, an error is thrown.

the only valid options are {live: true, old: false} {live: false, old: true} and {live: true, old: true}

I recomment using pull-notify to implement createLive.

var MyLiveStream = createLive(createSource, createLive)

pull(MyLiveStrea({live:..., old:...}),...)

License

MIT

FAQs

Package last updated on 20 May 2016

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