1. stream-array
Pipe an Array through Node.js streams
stream-array
Package: stream-array
Created by: mimetnet
Last modified: Mon, 27 Jun 2022 00:44:39 GMT
Version: 1.1.2
License: MIT
Downloads: 1,093,996
Repository: https://github.com/mimetnet/node-stream-array

Install

npm install stream-array
yarn add stream-array

stream-array

Pipe an Array through Node.js Streams. This is rather useful for testing
other streams.

npm version
build status
dependencies
devDependencies
Inch CI

Usage

 var streamify = require('stream-array'),
    os = require('os');

streamify(['1', '2', '3', os.EOL]).pipe(process.stdout);

API

streamify(Array)

The result of require is a 'function()' that when invoked, will return a
Readable Stream.

var streamify = require('stream-array');

The source array can contain any type as it is assumed that the receiving
stream can handle it. Each element in the array will be pushed into the
piped stream, without modifying the source array.

var readable = streamify(['Hello', new Buffer('World')]);

This Stream will push each element of the source array into the
piped array.

readable(['1', '2', '3', os.EOL]).pipe(process.stdout);
123\n

Install

 npm install stream-array

License

MIT License

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code