Small utility to create JSON objects

Related tags

JSON gjo
Overview

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

You might also like...
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 +--

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

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

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

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

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

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

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

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

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]}
    
    opened by gmlewis 1
  • 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"
    }
    
    opened by gstanchev 1
  • 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
    opened by hartzell 0
Owner
skanehira
Like Vim, Go, Docker
skanehira
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

fiatjaf 362 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

Milad Ebrahimi 33 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

Guillaume de Sagazan 93 Oct 24, 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

Maciek ZajÄ…c 110 Nov 6, 2022
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

Josh Baker 11.4k Nov 27, 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

William Poussier 215 Dec 1, 2022
Fast JSON encoder/decoder compatible with encoding/json for Go

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

Masaaki Goshima 1.9k Nov 23, 2022
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

High Performance, Kubernetes Native Object Storage 2 Jun 26, 2022
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

Samit Ghimire 7 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

null 6 Sep 14, 2022