Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
/ html-uglify Public archive

Uglifies an HTML file and its associated CSS for compression. Great for HTML emails.

License

Notifications You must be signed in to change notification settings

Rebelmail/html-uglify

Repository files navigation

html-uglify

Build Status NPM version

html-uglify

Uglify your HTML and CSS for purposes of compression and obfuscation.

Great for HTML emails.

var HTMLUglify = require('html-uglify');
var htmlUglify = new HTMLUglify({ salt: 'your-custom-salt', whitelist: ['#noform', '#withform', '.someclass'] });
var uglified = htmlUglify.process(htmlString);

Installation

npm install html-uglify --save

Usage

You pass an html string to .process and it returns the uglified html.

var HTMLUglify = require('html-uglify');
var htmlUglify = new HTMLUglify({ salt: 'your-custom-salt', whitelist: [] });
var htmlString = "<html><head><style>.some-class { color: red; }</style></head><body><h1 class='some-class'>Hello</h1></body></html>";

var uglified = htmlUglify.process(htmlString);

Contributing

  1. Fork it
  2. Create your feature branch
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Running tests

npm install
npm test

About

Uglifies an HTML file and its associated CSS for compression. Great for HTML emails.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •