doc: fix util.deprecate example
authorNick Raienko <enaqxx@gmail.com>
Mon, 27 Apr 2015 15:04:11 +0000 (18:04 +0300)
committerJeremiah Senkpiel <fishrock123@rocketmail.com>
Tue, 28 Apr 2015 14:12:13 +0000 (10:12 -0400)
PR-URL: https://github.com/iojs/io.js/pull/1535
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Julian Duque <julianduquej@gmail.com>
doc/api/util.markdown

index 77d9a8f66b58d4194f53bfd09f1529a7b0de74b5..8ac15826933743112e54d191609a99780d53eaec 100644 (file)
@@ -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.