nleiva / yangson

Adds and removes indentation to JSON files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yangson

Synopsis

Add and removes indentation to YANG config files JSON encoded.

Code Example

prettyprint takes a compact JSON config and pretty prints it.

	b, err := ioutil.ReadFile("files/bgp.json")
	if err != nil {
		fmt.Print(err)
	}

	b, _ = prettyprint(b)

unprettyprint takes an indented JSON config and pretty prints it.

	b, err := ioutil.ReadFile("files/bgp_formatted.json")
	if err != nil {
		fmt.Print(err)
	}

	b, _ = unprettyprint(b)

Where are we taking these JSON config files from?

To Do list

  • Incorporate commit/push configs on (github.go)
  • Add suport to clone or Wget/cURL a config (github.go)

See it in action

About

Adds and removes indentation to JSON files


Languages

Language:C++ 69.5%Language:CMake 15.6%Language:Go 14.9%