Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
util: mark util.pump() as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Aug 5, 2012
1 parent 74d076c commit 3219616
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/api/util.markdown
Expand Up @@ -170,7 +170,7 @@ Returns `true` if the given "object" is an `Error`. `false` otherwise.

## util.pump(readableStream, writableStream, [callback])

Experimental
**Deprecated**

Read the data from `readableStream` and send it to the `writableStream`.
When `writableStream.write(data)` returns `false` `readableStream` will be
Expand Down
6 changes: 4 additions & 2 deletions lib/util.js
Expand Up @@ -482,7 +482,7 @@ exports.exec = exports.deprecate(function() {
}, 'util.exec is now called `child_process.exec`.');


exports.pump = function(readStream, writeStream, callback) {
function pump(readStream, writeStream, callback) {
var callbackCalled = false;

function call(a, b, c) {
Expand Down Expand Up @@ -517,7 +517,9 @@ exports.pump = function(readStream, writeStream, callback) {
readStream.destroy();
call(err);
});
};
}
exports.pump = exports.deprecate(pump,
'util.pump() is deprecated. Use ReadableStream.prototype.pump() instead.');


/**
Expand Down

0 comments on commit 3219616

Please sign in to comment.