Skip to content

yuanliwei/cli-parse-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cli-parse-json

usage

$ 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

About

cli parse json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published