posthtml-remove-duplicates

0.0.4 • Public • Published

Posthtml-remove-duplicates

NPM version Travis Build Status XO code style

Installation

$ npm i --save posthtml-remove-duplicates

Usage

<!-- index.html -->
<html>
<body>
  <style>.a {color: black;}</style> 
  <style>.a {color: black;}</style> 
</body>
</html>
/* index.js */
var fs = require('fs');
var posthtml = require('posthtml');
 
posthtml()
  .use(require('posthtml-remove-duplicates')('style'))
  .process(fs.readFileSync('index.html', 'utf8'))
  .then(function(result) {
    return result; 
 
    /**
     * <html>
     *  <body>
     *    <style>.a {color: black;}</style>
     *  </body>
     * </html>
     */
  });

Api

selector: string: Selector to match html elements, passed to posthtml-match-helper.

License

MIT © Aleksandr Yakunichev

/posthtml-remove-duplicates/

    Package Sidebar

    Install

    npm i posthtml-remove-duplicates

    Weekly Downloads

    117

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • canvaskisa