Browse Source

init

master
Stephen McQuay 5 years ago
commit
01c5c905eb
3 changed files with 46 additions and 0 deletions
  1. +14
    -0
      LICENSE
  2. +10
    -0
      README.md
  3. +22
    -0
      main.go

+ 14
- 0
LICENSE View File

@@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

+ 10
- 0
README.md View File

@@ -0,0 +1,10 @@
jsoon
=====

Simple util for to be `python -mjson.tool` replacement. The second in my series
of small go programs to implement/replace cool tools I use frequently.

"jsoon" because it takes a json stream and expands it. Seriously, look at the
code; you'd have to really try hard to make a simpler program.

There are officially more letters in this readme at this point, actually.

+ 22
- 0
main.go View File

@@ -0,0 +1,22 @@
package main

import (
"bytes"
"encoding/json"
"io/ioutil"
"log"
"os"
)

func main() {
b, err := ioutil.ReadAll(os.Stdin)
if err != nil {
log.Fatal("problem reading stdin", err)
}
var out bytes.Buffer
err = json.Indent(&out, b, "", "\t")
if err != nil {
log.Fatal(err)
}
out.WriteTo(os.Stdout)
}

Loading…
Cancel
Save