commit b38bf1fe828be2db304a1ee247cfe79d57e07f31 Author: Charles Iliya Krempeaux Date: Wed Sep 27 13:45:27 2023 +0900 initial commits diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a3bf392 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2023 Charles Iliya Krempeaux :: http://changelog.ca/ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..add960d --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# go-jsonpp + +Package **jsonpp** provides tools for **pretty printing JSON**. + +**jsonpp** = **json pretty print** + +## Documention + +Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-jsonpp + +[![GoDoc](https://godoc.org/sourcecode.social/reiver/go-jsonpp?status.svg)](https://godoc.org/sourcecode.social/reiver/go-jsonpp) + +## Example + +Here is an example usage: + +```go +import "sourcecode.social/reiver/go-jsonpp" + +// ... + + +var jsn []byte // <--- contains JSON + +// ... + +jsonpp.PrettyPrint(jsn) // outputs the pretty-printed JSON to the STDOUT. +``` + +Can also send it to an `io.Writer` + +```go +import "sourcecode.social/reiver/go-jsonpp" + +// ... + + +var jsn []byte // <--- contains JSON + +// ... + +jsonpp.FPrettyPrint(writer, jsn) // outputs the pretty-printed JSON to an io.Writer. +``` + +Or return it as a `string`: + +```go +import "sourcecode.social/reiver/go-jsonpp" + +// ... + + +var jsn []byte // <--- contains JSON + +// ... + +s := jsonpp.SPrettyPrint(jsn) // returns the pretty-printed JSON as a string. +``` + + +## Import + +To import package **jsonpp** use `import` code like the follownig: +``` +import "sourcecode.social/reiver/go-jsonpp" +``` + +## Installation + +To install package **jsonpp** do the following: +``` +GOPROXY=direct https://sourcecode.social/reiver/go-jsonpp +``` + +## Author + +Package **jsonpp** was written by [Charles Iliya Krempeaux](http://changelog.ca)