summaryrefslogtreecommitdiff
path: root/lib/stream.js
diff options
context:
space:
mode:
authorElijah Insua <tmpvar@gmail.com>2011-07-11 01:35:25 -0400
committerisaacs <i@izs.me>2011-07-14 14:25:49 -0700
commitb722aaa8c52e580a7214451dc068a63ee2a3c0a4 (patch)
tree2310e9f9e792806d87daa223afb989fe27ec5b30 /lib/stream.js
parent9b5098f509a433d6eea93da8d74b6a118718058a (diff)
downloadnode-new-b722aaa8c52e580a7214451dc068a63ee2a3c0a4.tar.gz
Close #1303 Stream.pipe returns the destination
Squashed: * Simple change to make Stream.pipe(destination) return the destination Stream * Test: ensure Stream.pipe(destination) returns the destination Stream * updated Stream.pipe() documentation to reflect that it now returns the destination stream
Diffstat (limited to 'lib/stream.js')
-rw-r--r--lib/stream.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/stream.js b/lib/stream.js
index 1ad08ec14b..2869e8248f 100644
--- a/lib/stream.js
+++ b/lib/stream.js
@@ -157,4 +157,7 @@ Stream.prototype.pipe = function(dest, options) {
dest.on('close', cleanup);
dest.emit('pipe', source);
+
+ // Allow for unix-like usage: A.pipe(B).pipe(C)
+ return dest;
};