Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readable-stream@3 #344

Merged
merged 25 commits into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .airtap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sauce_connect: true
browsers:
- name: chrome
version: latest
platform: Windows 10
- name: internet explorer
version: latest
platform: Windows 10
- name: firefox
version: latest
platform: Windows 10
- name: safari
version: latest
platform: Mac 10.13
- name: microsoftedge
version: latest
platform: Windows 10
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
coverage
package-lock.json
*.tap
.airtaprc
57 changes: 12 additions & 45 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,22 @@
sudo: false
language: node_js
before_install:
- npm install -g npm@2
- test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
notifications:
email: false
matrix:
fast_finish: true
include:
- node_js: '0.8'
env:
- TASK=test
- NPM_LEGACY=true
- node_js: '0.10'
env:
- TASK=test
- NPM_LEGACY=true
- node_js: '0.11'
env:
- TASK=test
- NPM_LEGACY=true
- node_js: '0.12'
env:
- TASK=test
- NPM_LEGACY=true
- node_js: 1
env:
- TASK=test
- NPM_LEGACY=true
- node_js: 2
env:
- TASK=test
- NPM_LEGACY=true
- node_js: 3
env:
- TASK=test
- NPM_LEGACY=true
- node_js: 4
env: TASK=test
- node_js: 5
env: TASK=test
- node_js: 6
env: TASK=test
- node_js: 7
env: TASK=test
env: CMD=test
- node_js: 8
env: TASK=test
env: CMD=test
- node_js: 9
env: TASK=test
script: "npm run $TASK"
env:
global:
- secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
- secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
env: CMD=test
- node_js: 10
env: CMD=test
- node_js: stable
env: CMD=test-browsers
addons:
sauce_connect: true
hosts:
- airtap.local
script: npm run $CMD
45 changes: 38 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,59 @@
# readable-stream

***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
***Node.js core streams for userland*** [![Build Status](https://travis-ci.com/nodejs/readable-stream.svg?branch=master)](https://travis-ci.com/nodejs/readable-stream)


[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)


[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)
[![Sauce Test Status](https://saucelabs.com/browser-matrix/readabe-stream.svg)](https://saucelabs.com/u/readabe-stream)

```bash
npm install --save readable-stream
```

***Node-core streams for userland***
This package is a mirror of the streams implementations in Node.js.

This package is a mirror of the Streams2 and Streams3 implementations in
Node-core.

Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.8.0/docs/api/stream.html).

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](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).

As of version 2.0.0 **readable-stream** uses semantic versioning.

v3.x.x of `readable-stream` supports Node 6, 8, and 10, as well as
evergreen browsers, IE 11 and latest Safari.

v2.x.x of `readable-stream` supports all Node.js version 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][sauce]

# 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.

```js
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.

# Streams Working Group

`readable-stream` is maintained by the Streams Working Group, which
Expand Down Expand Up @@ -56,3 +85,5 @@ Node.js. The responsibilities of the Streams Working Group include:
* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) &lt;matteo.collina@gmail.com&gt;
- Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) &lt;shestak.irina@gmail.com&gt;

[sauce]: https://saucelabs.com
14 changes: 11 additions & 3 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (!usageVersionRegex.test(nodeVersion)) {
}

// `inputLoc`: URL or local path.
function processFile (inputLoc, out, replacements) {
function processFile (inputLoc, out, replacements, addAtEnd) {
var file = fs.createReadStream(inputLoc, encoding)

file.pipe(bl(function (err, data) {
Expand All @@ -55,6 +55,10 @@ function processFile (inputLoc, out, replacements) {
}
data = data.replace(regexp, arg2)
})

if (addAtEnd) {
data += addAtEnd
}
if (inputLoc.slice(-3) === '.js') {
try {
const transformed = babel.transform(data, {
Expand All @@ -68,7 +72,11 @@ function processFile (inputLoc, out, replacements) {
['transform-es2015-classes', { loose: true }],
'transform-es2015-destructuring',
'transform-es2015-computed-properties',
'transform-es2015-spread'
'transform-es2015-spread',
'transform-optional-catch-binding',
'transform-inline-imports-commonjs',
'transform-async-to-generator',
'transform-async-generator-functions'
]
})
data = transformed.code
Expand Down Expand Up @@ -113,7 +121,7 @@ function processTestFile (file) {
if (testReplace[file])
replacements = replacements.concat(testReplace[file])

processFile(url, out, replacements)
processFile(url, out, replacements, ';require(\'tap\').pass(\'sync run\');var _list = process.listeners(\'uncaughtException\'); process.removeAllListeners(\'uncaughtException\'); _list.pop(); _list.forEach((e) => process.on(\'uncaughtException\', e));')
}

//--------------------------------------------------------------------
Expand Down
Loading