
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
strip-attributes
Advanced tools
Strip attributes from HTML tags.
Install with npm:
$ npm install --save strip-attributes
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>'
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(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 && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.2.3, on January 04, 2017.
FAQs
Strip attributes from HTML tags.
The npm package strip-attributes receives a total of 479 weekly downloads. As such, strip-attributes popularity was classified as not popular.
We found that strip-attributes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.