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

@sovpro/delimited-stream

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sovpro/delimited-stream

A Transform stream emitting buffered data at each delimiter instance

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
increased by7.61%
Maintainers
1
Weekly downloads
 
Created
Source

Delimited Stream

A Node.js Transform stream emitting buffered data at each delimiter instance.

Build status for Node.js 8.x and newer

Constructor

The constructor requires a Buffer instance or string value representing the delimiter.

const stream = new DelimitedStream (delimiter)

Buffered data is emitted without the delimiter by default. To keep the delimiter, pass a truthy value as the second parameter.

// include delimiter in data
const stream = new DelimitedStream (delimiter, true)

Example

Instantiate a stream with a newline sequence as the delimiter.

const delimiter = Buffer.from ("\r\n")
const stream = new DelimitedStream (delimiter)
stream.on ('data', (data) => {
  const line = data.toString ('utf8')
  // do stuff
})

Keywords

FAQs

Package last updated on 14 Apr 2020

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