JSPM

web-streams-node

0.4.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2260
  • Score
    100M100P100Q111431F
  • License Apache-2.0

WhatWG web streams and conversion utilities for node.js

Package Exports

  • web-streams-node

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (web-streams-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

web-streams-node

WhatWG web streams and conversion utilities for node.js

This provides the WhatWG streams API for node. It leverages the WhatWG reference implementation

Installation

npm install web-streams-node

Usage

// ES5 require syntax
var webStreams = require('node-web-streams');
var ReadableStream = webStreams.ReadableStream;
var toWebReadableStream = webStreams.toWebReadableStream;
var toNodeReadable = webStreams.toNodeReadable;

// ES6 import syntax
import { ReadableStream, toWebReadableStream, toNodeReadable } from "node-web-streams";

// Convert a node Readable to a web ReadableStream & back
const nodeReadable = require('fs').createReadStream('/tmp/test.txt');
const webReadable = toWebReadableStream(nodeReadable);
const roundTrippedNodeReadable = toNodeReadable(webReadable);

Credits

Fork of node-web-streams

Original author: