forked from ddopson/underscore-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinspect-test.js
More file actions
executable file
·39 lines (31 loc) · 801 Bytes
/
inspect-test.js
File metadata and controls
executable file
·39 lines (31 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env node
var util = require('util');
var Formatter = require('./lib/formatter');
var obj = require('./example-data/corner-cases');
console.log("\n\nJSON:");
console.log(JSON.stringify(obj, null, ' '));
//obj.circular.deeper.still_deeper.obj = obj;
console.log("\n\nINSPECT:");
console.log(util.inspect(obj, false, 1, true));
/*
console.log("\n\nINSPECT2:");
console.log(util2.format(obj));
*/
console.log("\n\nINSPECT2(dense):");
var FormatterJson = Formatter.withConfig({
color: false,
wrapWidth: 100,
quoteKeys: true,
quotes: '"'
});
var FormatterPretty = Formatter.withConfig({
color: true,
wrapWidth: 100,
quoteKeys: false,
quotes: '"',
showHidden: true,
showAccessors: true,
jsonParity: false,
complexObjects: true
})
console.log(FormatterPretty(obj));