8000 GitHub - memoryhole/jjo at v1.0.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

memoryhole/jjo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jjo

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.

How to install

npm install -g jjo

Usage

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

Examples

Create Object

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
}

Create Array

jjo -a 123 "foor bar" {\"a\":123} false
[
    123,
    "foor bar",
    {
        "a": 123
    },
    true
]

Nesting

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"
    ]
}

See also

About

a small utility to create JSON objects, written for Node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0