console.dir(obj[, options])
obj
<any>options
<Object>showHidden
<boolean> 如果为true
,则也会显示对象的不可枚举属性和符号属性。默认值:false
。depth
<number> 告诉util.inspect()
格式化对象时要递归多少次。这对于检查大型复杂对象很有用。要使其无限递归,可传入null
。默认值:2
。colors
<boolean> 如果为true
,则输出将使用 ANSI 颜色代码进行样式设置。颜色可定制,请参见自定义util.inspect()
颜色。默认值:false
。
在 obj
上使用 util.inspect()
并将结果字符串打印到 stdout
。
此函数绕过 obj
上定义的任何自定义 inspect()
函数。
obj
<any>options
<Object>showHidden
<boolean> Iftrue
then the object's non-enumerable and symbol properties will be shown too. Default:false
.depth
<number> Tellsutil.inspect()
how many times to recurse while formatting the object. This is useful for inspecting large complicated objects. To make it recurse indefinitely, passnull
. Default:2
.colors
<boolean> Iftrue
, then the output will be styled with ANSI color codes. Colors are customizable; see customizingutil.inspect()
colors. Default:false
.
Uses util.inspect()
on obj
and prints the resulting string to stdout
.
This function bypasses any custom inspect()
function defined on obj
.