README.md 745 Bytes
Newer Older
Bob Williams's avatar
Bob Williams committed
1
2
# jsontools

3
4
5
6
7
Handy command line tools for dealing with json data.

## Tools

- **pp_json** - pretty prints json
8
- **is_json** - returns true if valid json; false otherwise
Bob Williams's avatar
Bob Williams committed
9

10
## Examples
Bob Williams's avatar
Bob Williams committed
11

12
##### pp_json
13

Bob Williams's avatar
Bob Williams committed
14
15
16
17
18
19
20
21
```sh
# curl json data and pretty print the results
curl https://coderwall.com/bobwilliams.json | pp_json

# pretty print the contents of an existing json file
less data.json | pp_json

# json data directly from the command line
22
echo '{"b":2, "a":1}' | pp_json
23
24
25
26
27
28
29
30
31
32
33
34
```

##### is_json
```sh
# curl json data and pretty print the results
curl https://coderwall.com/bobwilliams.json | is_json

# pretty print the contents of an existing json file
less data.json | is_json

# json data directly from the command line
echo '{"b":2, "a":1}' | is_json
35
```