Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

each-part

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

each-part

Transform stream which emits each part and pushes object with part

  • 0.7.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
increased by129.41%
Maintainers
1
Weekly downloads
 
Created
Source

each-part

Build Status Dependency Status npm version

Transform stream which emits each part and pushes object with part.

Uses newline and carriage return for default delimiter (one or both in either order).

Install

npm install each-part --save

Usage

eachLine = require 'each-part'

each = eachLine()
each.on 'part', (part) -> # do something with the part
each.on 'error', (error) -> # do something with the error...
each.on 'finish', (error) -> # all done...

# part is also passed on as an object to the next stream using objectMode:true
targetStream = require('through2') (part, _, next) ->
  # do something with the part: part.string
  console.log 'part:',part.string
  next()

someStream.pipe(each)

# can provide options to override the delimiter used:
each = eachLine delim:'|'

# can be a regular expression:
each = eachLine delim:/blah/

MIT License

FAQs

Package last updated on 09 Oct 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