
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
remove-html-comments
Advanced tools
Remove comments in html
$ npm install --save remove-html-comments
var removeHtmlComments = require('remove-html-comments');
removeHtmlComments('<!DOCTYPE html><!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>');
/*=> {
data: '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>',
comments: [ '<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->' ]
} */
$ npm install --global remove-html-comments
$ remove-html-comments --help
Usage
remove-html-comments <input-path>
remove-html-comments <input-path> <output-path>
cat <input-path> | remove-html-comments
Example
remove-html-comments index.html
remove-html-comments index.html no-comments.html
cat index.html | remove-html-comments
cat index.html | remove-html-comments > no-comments.html
Options
-v, --verbose Verbose output
MIT © Steve Mao
FAQs
Remove comments in html
The npm package remove-html-comments receives a total of 883 weekly downloads. As such, remove-html-comments popularity was classified as not popular.
We found that remove-html-comments demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.