[Pkg-javascript-commits] [node-lazystream] 01/01: Manually import version 1.0.0 to upstream branch

Sruthi Chandran srud-guest at moszumanska.debian.org
Tue Dec 6 06:06:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

srud-guest pushed a commit to branch upstream
in repository node-lazystream.

commit 95d4e138a6f1ff669424c382ebf6df99bad73e60
Author: Sruthi <srud at disroot.org>
Date:   Tue Dec 6 10:55:05 2016 +0530

    Manually import version 1.0.0 to upstream branch
---
 .gitignore            |  1 +
 .travis.yml           |  6 +++++-
 README.md             | 26 ++++++++++++++++++--------
 lib/lazystream.js     |  8 +++++---
 package.json          | 22 ++++++++++++----------
 test/readable_test.js |  8 +++++---
 6 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8030a49..baccd1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.DS_Store
 npm-debug.log
 node_modules/
 test/tmp/
diff --git a/.travis.yml b/.travis.yml
index 5c11909..01987d4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,9 @@
+sudo: false
 language: node_js
 node_js:
+  - "5.2"
+  - "4.2"
+  - "0.12"
   - "0.10"
-  - "0.8"
+# - "0.8"
 # - "0.6"
diff --git a/README.md b/README.md
index 3af9caf..f42fbac 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 # Lazy Streams
 
 > *Create streams lazily when they are read from or written to.*  
-> `lazystream: 0.0.2` [![Build Status](https://travis-ci.org/jpommerening/node-lazystream.png?branch=master)](https://travis-ci.org/jpommerening/node-lazystream)  
+> `lazystream: 1.0.0` [![Build Status](https://travis-ci.org/jpommerening/node-lazystream.png?branch=master)](https://travis-ci.org/jpommerening/node-lazystream)  
 
 ## Why?
 
@@ -11,7 +11,7 @@ From a software design point-of-view this sounds entirely reasonable. Then there
 > `Error: EMFILE, too many open files`  
 > ─ *node*
 
-This package provides two classes based on the node's new streams API (or `readable-stream` if you are using node a node version earlier than 0.10):
+This package provides two classes based on the node's Streams3 API (courtesy of `readable-stream` to ensure a stable version).
 
 ## Class: lazystream.Readable
 
@@ -57,14 +57,24 @@ new lazystream.Writable(function () {
 
 ```console
 $ npm install lazystream --save
-npm http GET https://registry.npmjs.org/readable-stream
-npm http 200 https://registry.npmjs.org/readable-stream
-npm http GET https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz
-npm http 200 https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz
-lazystream at 0.0.2 node_modules/lazystream
-└── readable-stream at 1.0.2
+lazystream at 1.0.0 node_modules/lazystream
+└── readable-stream at 2.0.5
 ```
 
+## Changelog
+
+### v1.0.0
+
+- [#2](https://github.com/jpommerening/node-lazystream/pull/2): [unconditionally](https://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html) use `readable-stream` _2.x_.
+
+### v0.2.0
+
+- [#1](https://github.com/jpommerening/node-lazystream/pull/1): error events are now propagated
+
+### v0.1.0
+
+- _(this was the first release)_
+
 ## Contributing
 
 Fork it, branch it, send me a pull request. We'll work out the rest together.
diff --git a/lib/lazystream.js b/lib/lazystream.js
index c6fbb39..d9f6170 100644
--- a/lib/lazystream.js
+++ b/lib/lazystream.js
@@ -1,6 +1,5 @@
-
 var util = require('util');
-var PassThrough = require('stream').PassThrough || require('readable-stream/passthrough');
+var PassThrough = require('readable-stream/passthrough');
 
 module.exports = {
   Readable: Readable,
@@ -29,7 +28,8 @@ function Readable(fn, options) {
 
   beforeFirstCall(this, '_read', function() {
     var source = fn.call(this, options);
-    var that = this;
+    var emit = this.emit.bind(this, 'error');
+    source.on('error', emit);
     source.pipe(this);
   });
 
@@ -44,6 +44,8 @@ function Writable(fn, options) {
 
   beforeFirstCall(this, '_write', function() {
     var destination = fn.call(this, options);
+    var emit = this.emit.bind(this, 'error');
+    destination.on('error', emit);
     this.pipe(destination);
   });
 
diff --git a/package.json b/package.json
index 215732c..a31a48c 100644
--- a/package.json
+++ b/package.json
@@ -1,11 +1,16 @@
 {
   "name": "lazystream",
-  "version": "0.1.0",
+  "version": "1.0.0",
   "description": "Open Node Streams on demand.",
   "homepage": "https://github.com/jpommerening/node-lazystream",
   "author": {
-    "name": "J. Pommerening"
+    "name": "Jonas Pommerening",
+    "email": "jonas.pommerening at gmail.com",
+    "url": "https://npmjs.org/~jpommerening"
   },
+  "contributors": [
+    "Mario Casciaro <mariocasciaro at gmail.com>"
+  ],
   "repository": {
     "type": "git",
     "url": "https://github.com/jpommerening/node-lazystream.git"
@@ -13,12 +18,7 @@
   "bugs": {
     "url": "https://github.com/jpommerening/node-lazystream/issues"
   },
-  "licenses": [
-    {
-      "type": "MIT",
-      "url": "https://github.com/jpommerening/node-lazystream/blob/master/LICENSE-MIT"
-    }
-  ],
+  "license": "MIT",
   "main": "lib/lazystream.js",
   "engines": {
     "node": ">= 0.6.3"
@@ -27,12 +27,14 @@
     "test": "nodeunit test/readable_test.js test/writable_test.js test/pipe_test.js test/fs_test.js"
   },
   "dependencies": {
-    "readable-stream": "~1.0.2"
+    "readable-stream": "^2.0.5"
   },
   "devDependencies": {
-    "nodeunit": "~0.7.4"
+    "nodeunit": "^0.9.1"
   },
   "keywords": [
+    "emfile",
+    "lazy",
     "streams",
     "stream"
   ]
diff --git a/test/readable_test.js b/test/readable_test.js
index 12eb05a..9ae0636 100644
--- a/test/readable_test.js
+++ b/test/readable_test.js
@@ -49,8 +49,10 @@ exports.readable = {
     test.equal(instantiated, false, 'DummyReadable should only be instantiated when it is needed');
 
     readable.on('readable', function() {
-      var chunk = readable.read();
-      actual.push(chunk.toString());
+      var chunk;
+      while ((chunk = readable.read())) {
+        actual.push(chunk.toString());
+      }
     });
     readable.on('end', function() {
       test.equal(actual.join(''), expected.join(''), 'Readable should not change the data of the underlying stream');
@@ -82,7 +84,7 @@ exports.readable = {
     });
 
     test.equal(instantiated, false, 'DummyReadable should only be instantiated when it is needed');
-    
+
     readable.resume();
   }
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-lazystream.git



More information about the Pkg-javascript-commits mailing list