strip-attributes v0.2.0
strip-attributes

Strip attributes from HTML tags.
Install
Install with npm:
$ npm install --save strip-attributesUsage
Pass a string of HTML to stripAttr():
var stripAttr = require('strip-attributes');
var str = '<h1 id="a" class="b">Foo</h1>';
// By default, all attributes are omitted
stripAttr(str);
//=> '<h1>Foo</h1>'Omit specific attributes
Pass an array of specific attributes to omit to options.omit:
stripAttr(str, {omit: ['class']});
//=> '<h1 id="a" >Foo</h1>'Keep specific attributes
Pass an array of specific attributes to keep to options.keep:
stripAttr(str, {keep: ['class']});
//=> '<h1 class="b">Foo</h1>'About
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verbRunning tests
Install dev dependencies:
$ npm install -d && npm testAuthor
Jon Schlinkert
License
Copyright © 2017, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.2.3, on January 04, 2017.