minify: github.com/tdewolff/minify/js Index | Examples | Files

package js

import "github.com/tdewolff/minify/js"

Package js minifies ECMAScript5.1 following the specifications at http://www.ecma-international.org/ecma-262/5.1/.

Index

Examples

Package Files

js.go

Variables

var DefaultMinifier = &Minifier{}

DefaultMinifier is the default minifier.

func Minify Uses

func Minify(m *minify.M, w io.Writer, r io.Reader, params map[string]string) error

Minify minifies JS data, it reads from r and writes to w.

Code:

m := minify.New()
m.AddFunc("application/javascript", Minify)

if err := m.Minify("application/javascript", os.Stdout, os.Stdin); err != nil {
    panic(err)
}

type Minifier Uses

type Minifier struct{}

Minifier is a JS minifier.

func (*Minifier) Minify Uses

func (o *Minifier) Minify(_ *minify.M, w io.Writer, r io.Reader, _ map[string]string) error

Minify minifies JS data, it reads from r and writes to w.

Package js imports 4 packages (graph) and is imported by 55 packages. Updated 2018-12-04. Refresh now. Tools for package owners.