
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
html2css-map
Advanced tools
html2css-map is a command-line tool that extracts inline styles from HTML files, converts them into reusable CSS classes, and rewrites the HTML with cleaner, class-based markup.
.html files for inline stylesclass="" attributesYou can install html2css-map as an npm package globally or as a devDependency:
npm install -g html2css-map
npm install --save-dev html2css-map
After installation, you can run the tool via npm scripts or directly through the command line.
Add the following script to your package.json:
{
"scripts": {
"html2css": "html2css-map --input ./src --output ./custom.css"
}
}
Run the script:
npm run html2css
./src folder (change to your current directory)custom.css file (change to your preferred name)Before:
<div style="color: red; font-size: 18px;">Hello</div>
After:
<div class="html2css-style-1">Hello</div>
custom.css:
.html2css-style-1 {
color: red;
font-size: 18px;
}
| Option | Description |
|---|---|
--input, -i | (Required) Path to the folder containing .html files to scan. |
--output, -o | (Required) Path to the output CSS file to generate. |
--dry | (Optional) If set, it will preview changes without modifying any files. |
--log | (Optional) Path to generate a JSON changelog file that tracks changes made. |
Contributions are welcome! If you encounter issues or have ideas to enhance the library, feel free to submit an issue or pull request.
FAQs
Extract inline styles into reusable CSS classes
The npm package html2css-map receives a total of 1 weekly downloads. As such, html2css-map popularity was classified as not popular.
We found that html2css-map demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.