package js
import "github.com/tdewolff/minify/v2/js"
Package js minifies ECMAScript 2021 following the language specification at https://tc39.es/ecma262/.
Index ¶
- Variables
- func Minify(m *minify.M, w io.Writer, r io.Reader, params map[string]string) error
- type Minifier
Examples ¶
Variables ¶
Functions ¶
func Minify ¶
Minify minifies JS data, it reads from r and writes to w.
Code:
Example¶
{
m := minify.New()
m.AddFunc("application/javascript", Minify)
if err := m.Minify("application/javascript", os.Stdout, os.Stdin); err != nil {
panic(err)
}
}
Types ¶
type Minifier ¶
type Minifier struct { Precision int // number of significant digits KeepVarNames bool Version int // contains filtered or unexported fields }
Minifier is a JS minifier.
func (*Minifier) Minify ¶
Minify minifies JS data, it reads from r and writes to w.
Source Files ¶
js.go stmtlist.go util.go vars.go
- Version
- v2.22.3 (latest)
- Published
- Mar 20, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 1 week ago –
Tools for package owners.