mholt / json-to-go

Translates JSON into a Go type in your browser instantly (original)
https://mholt.github.io/json-to-go/
MIT License
4.48k stars 473 forks source link

Add simple bin #106

Closed donatj closed 2 years ago

donatj commented 2 years ago

I've wanted to be able to run this from the command line for a couple years now. This is just a little node js wrapper for the library to make it possible.

There's certainly room to add flags and options and all that but I opted for dead simple read from standard input, write to standard output. Suited my needs anyway, I'm open to making any requested changes.

Should you be interested in publishing an npm install-able version, it'd be as easy as creating a package.json including a section:

    "bin": {
        "json-to-go": "./bin/json-to-go"
    },

Anway, great tool, use it almost every week.

mholt commented 2 years ago

Thanks, while I am glad you use json-to-go, I am not really interested in a binary.

If you want something executable, why not try an existing project that's actually designed to be a binary? https://github.com/twpayne/go-jsonstruct