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

stream-each

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-each

Iterate all the data in a stream

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6M
increased by2.9%
Maintainers
3
Weekly downloads
 
Created

What is stream-each?

The stream-each package is a utility that allows for iterating over the data in a readable stream one chunk at a time. It works by providing a function that is called for each chunk of data read from the stream, and a callback that is called when there is no more data or an error occurs.

What are stream-each's main functionalities?

Iterating over stream data

This feature allows you to process data from a stream chunk by chunk. The provided code sample demonstrates how to read from a file stream and log each chunk of data to the console.

const each = require('stream-each');
const fs = require('fs');

const stream = fs.createReadStream('/path/to/file.txt');
each(stream, function (chunk, next) {
  console.log(chunk.toString());
  next();
}, function (err) {
  if (err) throw err;
  console.log('Finished reading the stream.');
});

Other packages similar to stream-each

FAQs

Package last updated on 30 Jul 2018

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