Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reshape-minify

npm tests dependencies coverage

A reshape plugin to minify html

Note: This project is in early development, and versioning is a little different. Read this for more details.

Installation

npm install reshape-minify -S

Note: This project is compatible with node v6+ only

Usage

Add it as a plugin to reshape:

const reshape = require('reshape')
const minify = require('reshape-minify')

reshape({ plugins: minify(/* options */) })
  .process(someHtml)
  .then((res) => {
    console.log(res.output(/* locals */))
  })

Options

Options are passed in an object, all are optional.

Name Description Default
collapseWhitespace Removes all extra whitespace true
conservativeCollapse Instead of fully removing excess whitespace, collapses down to a single space false
aggressiveCollapse More aggressive whitespace removal, trims all whitespace from beginning and ends of any text false
removeComments Removes all comments from the html true
minifyCss Minifies any CSS in style tags true
minifyJs Minifies any JS in script tags true
minifySvg Minifies any inline svg true
minifyJson Minifies any json in script tags with */json as the type true

To-Do List

License & Contributing

About

a reshape plugin to minify html output

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.