JSON statistics

The following example shows how to use jsonlint to obtain statistics about a JSON document, with the --stats option.

$ curl https://api.github.com/users/dmeranda/repos | jsonlint --stats -
...
<stdin>: ----- Begin JSON statistics
   | Number of integers:
   |     8-bit:        43   (-128 to 127)
   |    16-bit:         3   (-32768 to 32767)
   |    32-bit:        14   (-2147483648 to 2147483647)
   |  > 53-bit:         0   (-9007199254740991 to 9007199254740991 - overflows JavaScript)
   |    64-bit:         0   (-9223372036854775808 to 9223372036854775807)
   |  > 64 bit:         0   (not portable, may require a "Big Num" package)
   |    total ints:    60
   |    Num -0:         0   (negative-zero integers are not portable)
   | Number of floats:
   |    doubles:        0
   |  > doubles:        0   (will overflow IEEE doubles)
   |    total flts:     0
   |    Num -0.0:       0   (negative-zero floats are usually portable)
   | Number of:
   |    nulls:          6
   |    booleans:      42
   |    arrays:         1
   |    objects:       12
   | Strings:
   |    number:           894 strings
   |    max length:       172 characters
   |    total chars:    24357 across all strings
   |    min codepoint: U+0020  (SPACE)
   |    max codepoint: U+007D  (RIGHT CURLY BRACKET)
   | Other JavaScript items:
   |    NaN:             0
   |    Infinite:        0
   |    undefined:       0
   |    Comments:        0
   |    Identifiers:     0
   | Max items in any array:     6
   | Max keys in any object:    67
   | Max nesting depth:          3
   | Unnecessary whitespace:  3296 of 30838 characters (10.69%)
<stdin>: ----- End of JSON statistics
<stdin>: ok