2. Story #1: View Raw Content
As a developer,
I want to see all the lines of a JSON text
file as-is when I specify on command
line,
$> prettyjson -r responses.json
So that I can know its contents.
3. Story #2: View raw content
with Line Numbers
As a developer,
I want to see all the lines of a JSON text
file with line numbers when I specify on
command line,
$> prettyjson -l responses.json
So that I can refer to lines with line
numbers.
4. Story #3: Show
Pretty JSON
As a developer
I want to see the JSON text file
in a pretty format with
indentation
$> prettyjson response.json
So that I can clearly see the
keys and their corresponding
values.
[
{
"ticker": "AAPL",
"high": 60.45,
"tickMillis": {
"high": 3000,
"low": 2000
},
"low": 50.35,
"price": 53.2,
"name": "Apple Inc."
},
{
"ticker": "GOOG",
"high": 120.34,
"tickMillis": {
"high": 2000,
"low": 1000
},
"low": 90.67,
"price": 97.28,
"name": "Google Inc."
}
]
5. Story #4: Pretty
JSON with Line #s
As a developer
I want to see the JSON text
file in a pretty format along
with indentation and line
numbers as shown
$> prettyjson -l response.json
So that I can also refer data
using line numbers.
1 [
2 {
3 "ticker": "AAPL",
4 "high": 60.45,
5 "tickMillis": {
6 "high": 3000,
7 "low": 2000
8 },
9 "low": 50.35,
10 "price": 53.2,
11 "name": "Apple Inc."
12 },
13 {
14 "ticker": "GOOG",
15 "high": 120.34,
16 "tickMillis": {
17 "high": 2000,
18 "low": 1000
19 },
20 "low": 90.67,
21 "price": 97.28,
22 "name": "Google Inc."
23 }
24 ]
6. Story #5: Pygmentized JSON
As a developer
I want to see the JSON text
file in a pretty format along
with colours as shown
$> prettyjson response.json
So that I can recognise keys
are blue, numbers are in
yellow and strings are in
green colour.
7. NOTE: this command conflicts
with Story #3. So, we introduce
another option “nc” to produce
monochrome (not colored)
output. This will not break
Story #3.
$> prettyjson -nc response.json
Story #5:
Pygmentized JSON
[
{
"ticker": "AAPL",
"high": 60.45,
"tickMillis": {
"high": 3000,
"low": 2000
},
"low": 50.35,
"price": 53.2,
"name": "Apple Inc."
},
{
"ticker": "GOOG",
"high": 120.34,
"tickMillis": {
"high": 2000,
"low": 1000
},
"low": 90.67,
"price": 97.28,
"name": "Google Inc."
}
]
8. Story #6: Pygmentized JSON
with Line numbers
As a developer
I want to see the JSON text file
in a pretty format along with
lines numbers in colour and
colours as shown
$> prettyjson -l response.json
So that I can recognise keys are
blue, numbers are in yellow
and strings are in green colour.
9. Story #7: View Raw with all
possible options
I want to see the JSON text file in a raw format
with or without lines numbers, with to without
colours
$> prettyjson -l -r response.json
$> prettyjson -r response.json
$> prettyjson -l -r -nc response.json (same output as story#2)