node-web-streams

WebJar for node-web-streams

License

License

GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

node-web-streams
Last Version

Last Version

0.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

node-web-streams
WebJar for node-web-streams
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/gwicke/node-web-streams

Download node-web-streams

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/node-web-streams/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>node-web-streams</artifactId>
    <version>0.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/node-web-streams/
implementation 'org.webjars.npm:node-web-streams:0.2.2'
// https://jarcasting.com/artifacts/org.webjars.npm/node-web-streams/
implementation ("org.webjars.npm:node-web-streams:0.2.2")
'org.webjars.npm:node-web-streams:jar:0.2.2'
<dependency org="org.webjars.npm" name="node-web-streams" rev="0.2.2">
  <artifact name="node-web-streams" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='node-web-streams', version='0.2.2')
)
libraryDependencies += "org.webjars.npm" % "node-web-streams" % "0.2.2"
[org.webjars.npm/node-web-streams "0.2.2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : is-stream jar [1.1.0,2)
org.webjars.npm » github-com-gwicke-web-streams-polyfill jar [spec_performance_improvements]

Project Modules

There are no modules declared in this project.

node-web-streams

WhatWG web streams and conversion utilities for node.js

This provides the WhatWG streams API for node. It leverages the WhatWG reference implementation, but also addresses performance issues in that implementation.

Installation

npm install node-web-streams

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);

Versions

Version
0.2.2