Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

web-streams-extensions

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-streams-extensions

A comprehensive collection of helper methods for WebStreams with built-in backpressure support, inspired by ReactiveExtensions

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
1.2K
-35.8%
Maintainers
1
Weekly downloads
 
Created
Source

WebStream Extensions

npm version Build Status codecov License: MIT

A collection helper methods for WebStreams, inspired by ReactiveExtensions.

Installation

npm install web-streams-extensions
  • dist folder has CJS and ESM entry points.
  • recommended to use a bundler with tree-shaking support.

Basic Usage

import { from, pipe, map, filter, toArray } from 'web-streams-extensions';

// Create a stream from an array and process it
const stream = pipe(
  from([1, 2, 3, 4, 5, 6]),
  filter(x => x % 2 === 0),  // Keep even numbers
  map(x => x * 2)            // Double them
);

const result = await toArray(stream);
console.log(result); // [4, 8, 12]

⚠️ReadableStreams are not recoverable. If you start and consume a stream, that instance cannot be reused.

API Reference

Browser Compatibility

This library requires support for:

  • ReadableStream (for all functionality)
  • WritableStream (for Subjects)
  • async/await (ES2017)

For older browsers, use the web-streams-polyfill:

import 'web-streams-polyfill/polyfill';
import { from, pipe, map } from 'web-streams-extensions';

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Keywords

web

FAQs

Package last updated on 04 Mar 2026

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