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

A PostHTML plugin to rewrite CSS identifiers in HTML

License

Notifications You must be signed in to change notification settings

Rebelmail/posthtml-uglify

Repository files navigation

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

About

A PostHTML plugin to rewrite CSS identifiers in HTML

Resources

License

Stars

Watchers

Forks

Packages

No packages published