Giter VIP home page Giter VIP logo

readable-stream's Introduction

readable-stream

Node.js core streams for userland

npm status node Node.js Sauce Labs

Sauce Test Status

npm install --save readable-stream

This package is a mirror of the streams implementations in Node.js.

Full documentation may be found on the Node.js website.

If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use readable-stream only and avoid the "stream" module in Node-core, for background see this blogpost.

As of version 2.0.0 readable-stream uses semantic versioning.

Version 3.x.x

v3.x.x of readable-stream is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in Node v9 and Node v10, as follows:

  1. Error codes: nodejs/node#13310, nodejs/node#13291, nodejs/node#16589, nodejs/node#15042, nodejs/node#15665, nodejs#344
  2. 'readable' have precedence over flowing nodejs/node#18994
  3. make virtual methods errors consistent nodejs/node#18813
  4. updated streams error handling nodejs/node#18438
  5. writable.end should return this. nodejs/node#18780
  6. readable continues to read when push('') nodejs/node#18211
  7. add custom inspect to BufferList nodejs/node#17907
  8. always defer 'readable' with nextTick nodejs/node#17979

Version 2.x.x

v2.x.x of readable-stream is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11.

Big Thanks

Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs

Usage

You can swap your require('stream') with require('readable-stream') without any changes, if you are just using one of the main classes and functions.

const {
  Readable,
  Writable,
  Transform,
  Duplex,
  pipeline,
  finished
} = require('readable-stream')

Note that require('stream') will return Stream, while require('readable-stream') will return Readable. We discourage using whatever is exported directly, but rather use one of the properties as shown in the example above.

Usage In Browsers

You will need a bundler like browserify, webpack, parcel or similar. With Webpack 5 (which unlike other bundlers does not polyfill Node.js core modules and globals like process) you will also need to:

  1. Install polyfills by running npm install buffer process --save-dev
  2. Create a webpack.config.js file containing:
const webpack = require('webpack')

module.exports = {
  plugins: [
    new webpack.ProvidePlugin({
      process: 'process/browser'
    })
  ],
  resolve: {
    fallback: {
      buffer: require.resolve('buffer/')
    }
  }
}

Streams Working Group

readable-stream is maintained by the Streams Working Group, which oversees the development and maintenance of the Streams API within Node.js. The responsibilities of the Streams Working Group include:

  • Addressing stream issues on the Node.js issue tracker.
  • Authoring and editing stream documentation within the Node.js project.
  • Reviewing changes to stream subclasses within the Node.js project.
  • Redirecting changes to streams from the Node.js project to this project.
  • Assisting in the implementation of stream providers within Node.js.
  • Recommending versions of readable-stream to be included in Node.js.
  • Messaging about the future of streams to give the community advance notice of changes.

Team Members

readable-stream's People

Contributors

mcollina avatar isaacs avatar calvinmetcalf avatar rvagg avatar vweevers avatar jmm avatar tootallnate avatar sonewman avatar chrisdickinson avatar raynos avatar shinnn avatar mafintosh avatar realityking avatar kolodny avatar trxcllnt avatar rangermauve avatar rwaldron avatar ronag avatar stevemao avatar styfle avatar bnb avatar timgestson avatar xhmikosr avatar cclauss avatar deoxxa avatar kumavis avatar lrlna avatar mhdawson avatar max-mapper avatar jmounier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.