🚀 DAY 3 OF LAUNCH WEEK: Introducing Webhook Events for Pull Request Scans.Learn more →
Socket
Book a DemoInstallSign in
Socket

@nitedani/rxjs-stream

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nitedani/rxjs-stream

Currently this package has one function: `fromReadStream<T>(readStream:stream.Readable): Observable<T>` `fromReadStream` creates an rxjs observable from a node readstream with backpressure support. How it works: the underlying read

Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
77
75%
Maintainers
1
Weekly downloads
 
Created
Source

Currently this package has one function:
fromReadStream<T>(readStream:stream.Readable): Observable<T>

fromReadStream creates an rxjs observable from a node readstream with backpressure support.
How it works: the underlying readstream is paused whenever a new chunk is read, and resumed after the value is emitted and processed by the observer.

Example:

const rs = createReadStream("huge_file.txt");
fromReadStream<string>(rs)
  .pipe(
    tap((chunk) => {
      console.log("Processing chunk...", chunk);
    }),
    map((chunk) => chunk.toLowerCase()),
    delay(1000)
  )
  .subscribe((chunk) => console.log(chunk));

FAQs

Package last updated on 24 Jan 2021

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