npm install strip-commentstrip-comment
=============
Strip js, css, and html comments.
npm install strip-comment --save
`
$3
`
mocha
`
$3
`html
This is a paragraph.
// html content`
`js
var fs = require('fs');
var html = fs.readFileSync('./index.html', { encoding: 'utf8' });
var strip = require('strip-comment');strip(html); // Strip js css and html comments.
`
API
$3
Strip html css and js comments
* {string} code required
* {boolean} keep [keep = false]
Keep the source code lines and columns$3
Strip js comments
* {string} code required
* {boolean} keep [keep = false]
`js
var js = 'var a = 3; // comment'
strip.js(js);
strip.js(js, true); // keep code lines
`$3
Strip css comments
* {string} code required
* {boolean} keep [keep = false]
`js
var css = 'h2 { / comment / font-size : 18px; }'
strip.css(css);
`$3
Strip html comments
* {string} code required
* {boolean} keep [keep = false]
`js
var html = ''
strip.html(html);
``