jjo is a small utility to create JSON objects that was inspired by jpmens/jo and skanehira/gjo.
I figured why not add a Javascript version for node.js as well.
npm install -g jjo
Usage: jjo [options] [items...]
a small utility to create JSON objects
Options:
-V, --version output the version number
-a, --array create a json array
-h, --help output usage information
jjo number=123 float=123.12 string="this is a string" otherstring=foobar object={\"a\":true} array=[1,2,3] boolean=true
{
"number": 123,
"float": 123.12,
"string": "this is a string",
"otherstring": "foobar",
"object": {
"a": true
},
"array": [
1,
2,
3
],
"boolean": true
}
jjo -a 123 "foor bar" {\"a\":123} false
[
123,
"foor bar",
{
"a": 123
},
true
]
jjo somekey=false array=$(jjo -a *)
{
"somekey": true,
"array": [
"dist",
"jest.config.js",
"LICENSE",
"node_modules",
"package.json",
"package-lock.json",
"README.md",
"src",
"tsconfig.json"
]
}