File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,21 @@ through the `constructor.super_` property.
257257 stream.write("It works!"); // Received data: "It works!"
258258
259259
260+ ## util.deprecate(function, string)
261+
262+ Marks that a method should not be used any more.
263+
264+ exports.puts = exports.deprecate(function() {
265+ for (var i = 0, len = arguments.length; i < len; ++i) {
266+ process.stdout.write(arguments[i] + '\n');
267+ }
268+ }, 'util.puts: Use console.log instead')
269+
270+ It returns a modified function which warns once by default. If
271+ ` --no-deprecation ` is set then this function is a NO-OP. If
272+ ` --throw-deprecation ` is set then the application will throw an exception
273+ if the deprecated API is used.
274+
260275## util.debug(string)
261276
262277 Stability: 0 - Deprecated: use console.error() instead.
You can’t perform that action at this time.
0 commit comments