$ echo '{"name":"abc","age":13,"address":{"city":"beijing","code":122345},"phones":["12345","67890"]}' | cli-parse-json '.name'
=> abc
$ echo '{"name":"abc","age":13,"address":{"city":"beijing","code":122345},"phones":["12345","67890"]}' | cli-parse-json '.name.substring(0,1)'
=> a
$ echo '{"name":"abc","age":13,"address":{"city":"beijing","code":122345},"phones":["12345","67890"]}' | cli-parse-json '.name.toUpperCase()'
=> ABC
$ echo '{"name":"abc","age":13,"address":{"city":"beijing","code":122345},"phones":["12345","67890"]}' | cli-parse-json '.address.city'
=> beijing
$ echo '{"name":"abc","age":13,"address":{"city":"beijing","code":122345},"phones":["12345","67890"]}' | cli-parse-json '.phones[1]'
=> 67890
-
Notifications
You must be signed in to change notification settings - Fork 0
yuanliwei/cli-parse-json
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
cli parse json
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published