posthtml-uglify

2.0.0 • Public • Published

posthtml-uglify

Build Status Coverage Status npm version Dependency Status devDependency Status

A PostHTML plugin to rewrite CSS identifiers in HTML for the purposes of compression and obfuscation.

Installation

npm install posthtml-uglify --save

Usage

var posthtml = require('posthtml');
var uglify = require('posthtml-uglify');
 
posthtml()
  .use(uglify({ whitelist: '.bar' }))
  .process('<style>#foo { color: red } .bar { color: blue }</style><div id="foo" class="bar">baz</div>')
  .then(function(result) {
    console.log(result.html); //=> '<style>#xz { color: red } .bar { color: blue }</style><div id="xz" class="bar">baz</div>'
  });

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

Package Sidebar

Install

npm i posthtml-uglify

Weekly Downloads

25

Version

2.0.0

License

ISC

Unpacked Size

36 kB

Total Files

14

Last publish

Collaborators

  • devinus