Skip to content
/ jsg Public

json generator for terminal usage, influenced by httpie

License

Notifications You must be signed in to change notification settings

umurgdk/jsg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsg - simple json generator

Writing json in the terminal is such a pain because of the escaping all the charcters. jsg mimics how httpie generates the json for the request bodies, accepting key values as program arguments.

Building

$ cargo build

Example Usage

# simple object
jsg name=jsg num_str=25 num:=25 bool:=true some:=null
'{"name":"jsg","num_str":"25","num":25,"bool":true,"some":null}'

# nested objects
jsg name=test obj:="$(jsg field=value)" arr:="$(jsg --arr 1 string true)"
'{"name":"test","obj":{"field":"value"},"arr":[1,"string",true]}'

# arrays
jsg --arr 1 'string with spaces' string 3
'[1, "string with spaces", "string", 3]'

# arrays - do not evaluate types and accept everything as strings
jsg --arr-str 12 str
'["12", "str"]'

About

json generator for terminal usage, influenced by httpie

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages