Skip to content

Commit 022c083

Browse files
committed
Deprecate sys.p()
1 parent 44ad6a7 commit 022c083

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/sys.js

+6
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,13 @@ exports.inspect = function (obj, showHidden, depth) {
182182
return format(obj, (typeof depth === 'undefined' ? 2 : depth));
183183
};
184184

185+
var pWarning;
186+
185187
exports.p = function () {
188+
if (!pWarning) {
189+
pWarning = "sys.p will be removed in future versions of Node. Use sys.puts(sys.inspect()) instead.\n";
190+
exports.error(pWarning);
191+
}
186192
for (var i = 0, len = arguments.length; i < len; ++i) {
187193
error(exports.inspect(arguments[i]));
188194
}

0 commit comments

Comments
 (0)