A synchronous output function. Will block the process and
output the string immediately to stdout.
-+inspect(object)+ ::
-Return a string representation of the +object+. (For debugging.)
++inspect(object, showHidden)+ ::
+Return a string representation of the +object+. (For debugging.) If showHidden is true, then the object's non-enumerable properties will be shown too.
+exec(command)+::
Executes the command as a child process, buffers the output and returns it
exports.inspect = function (obj, showHidden) {
var seen = [];
function format(value) {
- var keys, visible_keys, base, type, braces;
// Primitive types cannot have properties
switch (typeof value) {
case 'undefined': return 'undefined';
}
// Look up the keys of the object.
- keys = showHidden ? Object.getOwnPropertyNames(value).map(function (key) {
+ var keys = showHidden ? Object.getOwnPropertyNames(value).map(function (key) {
return '' + key;
}) : Object.keys(value);
- visible_keys = Object.keys(value);
+ var visible_keys = Object.keys(value);
// Functions without properties can be shortcutted.
if (typeof value === 'function' && keys.length === 0) {
}
}
+ var base, type, braces;
// Determine the object type
if (value instanceof Array) {
type = 'Array';
*/
exports.inherits = process.inherits;
-// Object.create(null, {name: {value: "Tim", enumerable: true}})
\ No newline at end of file