minifier

package module
v0.0.0-...-21465d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 10 Imported by: 0

README

minifier

This package implements a Minifier for tdewolff's Minify project. The Minifier takes three parameters, the output dest., the mime type, and the paths to minify. The package will create a new file at the dest. containing the minified program files.

The Minifier performs a recursive walk on directories provided in the variadac string parameter. All files are read into memory and after all paths have been walked, the contents are minified and written to the output file.

The minifier will ignore the destination file if it exists in the tree being enumerated

The Minifier will not throw an error when handling multiple mime types per call (but your projects will ;)

Usage

Run the following command from your project directory

go get -u github.com/syhv-git/minifier

You can then import and use the package with the minifier.Minifier() function.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Minifier

func Minifier(fp, mime string, dir ...string) error

Minifier takes three parameters and creates a minified file given by fp. mime is the media type for the files located at dir. dir can be a directory or individual files.

The function will skip file fp if it is located in dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL