README.md 735 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
9
- **urlencode_json** - returns a url encoded string for the given json 
Bob Williams's avatar
Bob Williams committed
10

11
12
13
14
15
## Usage
Usage is simple...just take your json data and pipe it into the appropriate jsontool.
```sh
<json data> | <jsontools tool>
```
16
## Examples
Bob Williams's avatar
Bob Williams committed
17

18
##### pp_json
19

Bob Williams's avatar
Bob Williams committed
20
21
22
```sh
# curl json data and pretty print the results
curl https://coderwall.com/bobwilliams.json | pp_json
23
24
25
26
27
28
```

##### is_json
```sh
# pretty print the contents of an existing json file
less data.json | is_json
29
```
30

31
32
##### urlencode_json
```sh
33
# json data directly from the command line
34
echo '{"b":2, "a":1}' | urlencode_json
35
```