Skip to content
/ catjson Public

A little helper script to make JSON files better "grepable"

License

Notifications You must be signed in to change notification settings

Footur/catjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

cat JSON

This is a little helper script to make JSON files better "grepable". It's inspired by this Hacker News thread.

{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25,
  "address": {
    "streetAddress": "21 2nd Street",
    "city": "New York",
    "state": "NY",
    "postalCode": "10021"
  },
  "phoneNumber": [
    {
      "type": "home",
      "number": "212 555-1234"
    },
    {
      "type": "fax",
      "number": "646 555-4567"
    }
  ],
  "gender": {
    "type": "male"
  }
}

Output of catjson.sh

./catjson.sh /tmp/foobar.json

.address.city = "New York"
.address.postalCode = "10021"
.address.state = "NY"
.address.streetAddress = "21 2nd Street"
.age = 25
.firstName = "John"
.gender.type = "male"
.lastName = "Smith"
.phoneNumber[0].number = "212 555-1234"
.phoneNumber[0].type = "home"
.phoneNumber[1].number = "646 555-4567"
.phoneNumber[1].type = "fax"

About

A little helper script to make JSON files better "grepable"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages