You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
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
npmnpm
Version published
Weekly downloads
6.6M
10.06%
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