package json
import "github.com/tdewolff/minify/v2/json"
Package json minifies JSON following the specifications at http://json.org/.
Index ¶
Examples ¶
Functions ¶
func Minify ¶
Minify minifies JSON data, it reads from r and writes to w.
Code:
Example¶
{
m := minify.New()
m.AddFuncRegexp(regexp.MustCompile("[/+]json$"), Minify)
if err := m.Minify("application/json", os.Stdout, os.Stdin); err != nil {
panic(err)
}
}
Types ¶
type Minifier ¶
type Minifier struct { Precision int // number of significant digits KeepNumbers bool // prevent numbers from being minified }
Minifier is a JSON minifier.
func (*Minifier) Minify ¶
Minify minifies JSON data, it reads from r and writes to w.
Source Files ¶
- Version
- v2.21.3 (latest)
- Published
- Jan 14, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 4 days ago –
Tools for package owners.