https://github.com/yacodes/posthtml-remove-duplicates
Remove duplicate tags from html
https://github.com/yacodes/posthtml-remove-duplicates
Last synced: about 2 months ago
JSON representation
Remove duplicate tags from html
- Host: GitHub
- URL: https://github.com/yacodes/posthtml-remove-duplicates
- Owner: yacodes
- License: mit
- Created: 2016-05-24T12:18:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-29T16:37:53.000Z (almost 9 years ago)
- Last Synced: 2025-02-04T13:04:06.570Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Posthtml-remove-duplicates
[](https://www.npmjs.org/package/posthtml-remove-duplicates)
[](https://travis-ci.org/canvaskisa/posthtml-remove-duplicates)
[](https://github.com/sindresorhus/xo)## Installation
```console
$ npm i --save posthtml-remove-duplicates
```## Usage
```html.a {color: black;}
.a {color: black;}```
```js
/* 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;/**
*
*
* .a {color: black;}
*
*
*/
});
```## Api
`selector: string`: Selector to match html elements, passed to [posthtml-match-helper](https://github.com/rasmusfl0e/posthtml-match-helper).## License
MIT © [Aleksandr Yakunichev](https://github.com/canvaskisa)