Skip to content

Commit

Permalink
doc: fix util.deprecate example
Browse files Browse the repository at this point in the history
PR-URL: nodejs#1535
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Julian Duque <[email protected]>
  • Loading branch information
enaqx authored and Fishrock123 committed Apr 28, 2015
1 parent 2a3c8c1 commit e55fdc4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/api/util.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,13 @@ through the `constructor.super_` property.

Marks that a method should not be used any more.

exports.puts = exports.deprecate(function() {
var util = require('util');

exports.puts = util.deprecate(function() {
for (var i = 0, len = arguments.length; i < len; ++i) {
process.stdout.write(arguments[i] + '\n');
}
}, 'util.puts: Use console.log instead')
}, 'util.puts: Use console.log instead');

It returns a modified function which warns once by default.

Expand Down

0 comments on commit e55fdc4

Please sign in to comment.