Small utility to create JSON objects

gjo

GitHub Actions status CircleCI Go Report Card

Small utility to create JSON objects.
This was inspired by jpmens/jo.

sreenshot

Support OS

  • Mac
  • Linux
  • Windows

Requirements

  • Go 1.1.14~
  • Git

Installtion

Build

$ git clone https://github.com/skanehira/gjo.git
$ cd gjo
$ GO111MODULE=on go install

Binary

Please download from releases

Usage

Mac and Linux

$ gjo -p status=$(gjo name=gorilla age=26 lang=$(gjo -a Go Java PHP))
{
    "status": {
        "age": 26,
        "lang": [
            "Go",
            "Java",
            "PHP"
        ],
        "name": "gorilla"
    }
}
$ gjo -h
Usage of gjo:
  -a    creates an array of words
  -p    pretty-prints
  -v    show version

Windows

If you want to use $() on the Windows, please install shellwrap.

shellwrap gjo -p status=$(gjo name=gorilla age=26)

Author

gorilla0513

Owner
skanehira
Like Vim, Go, Docker
skanehira
Similar Resources

A Small tool for SDWAN performance test and policy validation

sdwan-perf Sdwan-perf is based on golang and could support almost platform for performance and policy validation. SDWAN Performance Test Report +--

Sep 3, 2022

simple utility to compare the node's latest block with the source of truth

Near Deer A simple utility to compare the node's latest block with the source of truth (checks against https://rpc..near.org/status) Example usage: al

Dec 13, 2021

Abstract JSON for golang with JSONPath support

Abstract JSON Abstract JSON is a small golang package provides a parser for JSON with support of JSONPath, in case when you are not sure in its struct

Jan 5, 2023

Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection

fastjson - fast JSON parser and validator for Go Features Fast. As usual, up to 15x faster than the standard encoding/json. See benchmarks. Parses arb

Jan 5, 2023

A Go package for handling common HTTP JSON responses.

go-respond A Go package for handling common HTTP JSON responses. Installation go get github.com/nicklaw5/go-respond Usage The goal of go-respond is to

Sep 26, 2022

JSON query in Golang

gojq JSON query in Golang. Install go get -u github.com/elgs/gojq This library serves three purposes: makes parsing JSON configuration file much easie

Dec 28, 2022

Automatically generate Go (golang) struct definitions from example JSON

gojson gojson generates go struct definitions from json or yaml documents. Example $ curl -s https://api.github.com/repos/chimeracoder/gojson | gojson

Jan 1, 2023

Fast and flexible JSON encoder for Go

Fast and flexible JSON encoder for Go

Jettison Jettison is a fast and flexible JSON encoder for the Go programming language, inspired by bet365/jingo, with a richer features set, aiming at

Dec 21, 2022

Console JSON formatter with query feature

Console JSON formatter with query feature

Console JSON formatter with query feature. Install: $ go get github.com/miolini/jsonf Usage: Usage of jsonf: -c=true: colorize output -d=false: de

Dec 4, 2022
Comments
  • Easier installation instructions for README.md

    Easier installation instructions for README.md

    Very cool tool... thank you very much!

    I think your installation instructions could be easier... this worked for me:

    $ go get github.com/skanehira/gjo
    $ which gjo
    /home/glenn/go/bin/gjo
    $ gjo one=two three=$(gjo -a 1 2 3)
    {"one":"two","three":[1,2,3]}
    
  • How to output an empty string

    How to output an empty string

    gjo status=$(gjo a="" foo=bar)

    produces

    {
      "a":null,
      "foo":"bar"
    }
    

    How do you get it to

    {
      "a":"",
      "foo":"bar"
    }
    
  • Add missing jo options

    Add missing jo options

    Add support for several options that jo supports but gjo does not

    • -B -- disable treating true/false as bool
    • -e -- empty stdin is not an error
    • -n -- ignore keys with empty values
    • read from stdin if not args are supplied

    It adds code to handle the various features, modifies the run function to take an io.Reader as an argument for testability, and calls the run function with os.Stdin in main.

    It modifies the TestRun test:

    • The test cases have been updated:
      • renamed fields to be clear about meaning
      • only non-zero test values need to be supplied in the test case
      • provides stdin as a string.Reader
      • provides want_stdout to hold the expected output
    • Tests have been added for new features
Related tags
simplest possible native GUI for inspecting JSON objects with jq
simplest possible native GUI for inspecting JSON objects with jq

./jqview The simplest possible native GUI for inspecting JSON objects with jq. Made with Qt and gojq. Usage ~> echo '[{"name": "Mises"}, {"name": "Hay

Oct 20, 2022
vjson is a Go package that helps to validate JSON objects in a declarative way.

vjson vjson is a Go package that helps to validate JSON objects in a declarative way. Getting Started Installing For installing vjson, use command bel

Nov 24, 2022
A JSON diff utility

JayDiff A JSON diff utility. Install Downloading the compiled binary Download the latest version of the binary: releases extract the archive and place

Dec 11, 2022
Create go type representation from json

json2go Package json2go provides utilities for creating go type representation from json inputs. Json2go can be used in various ways: CLI tool Web pag

Dec 26, 2022
Get JSON values quickly - JSON parser for Go
Get JSON values quickly - JSON parser for Go

get json values quickly GJSON is a Go package that provides a fast and simple way to get values from a json document. It has features such as one line

Dec 28, 2022
JSON diff library for Go based on RFC6902 (JSON Patch)

jsondiff jsondiff is a Go package for computing the diff between two JSON documents as a series of RFC6902 (JSON Patch) operations, which is particula

Dec 4, 2022
Fast JSON encoder/decoder compatible with encoding/json for Go
Fast JSON encoder/decoder compatible with encoding/json for Go

Fast JSON encoder/decoder compatible with encoding/json for Go

Jan 6, 2023
Package json implements encoding and decoding of JSON as defined in RFC 7159

Package json implements encoding and decoding of JSON as defined in RFC 7159. The mapping between JSON and Go values is described in the documentation for the Marshal and Unmarshal functions

Jun 26, 2022
Json-go - CLI to convert JSON to go and vice versa
Json-go - CLI to convert JSON to go and vice versa

Json To Go Struct CLI Install Go version 1.17 go install github.com/samit22/js

Jul 29, 2022
JSON Spanner - A Go package that provides a fast and simple way to filter or transform a json document

JSON SPANNER JSON Spanner is a Go package that provides a fast and simple way to

Sep 14, 2022