strip-css-comments alternatives and similar modules
Based on the "Parsing" category.
Alternatively, view strip-css-comments alternatives based on common mentions on social networks and blogs.
-
markdown-it
Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed -
remark
markdown processor powered by plugins part of the @unifiedjs collective -
@parcel/css
An extremely fast CSS parser, transformer, bundler, and minifier written in Rust. -
nearley
๐๐๐ฒ Simple, fast, powerful parser toolkit for JavaScript. -
parse5
HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant. -
fast-xml-parser
Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback. -
csv-parser
Streaming csv parser inspired by binary-csv that aims to be faster than everyone else -
google-libphonenumber
The up-to-date and reliable Google's libphonenumber package for node.js. -
xlsx-populate
Excel XLSX parser/generator written in JavaScript with Node.js and browser support, jQuery/d3-style method chaining, encryption, and a focus on keeping existing workbook features and styles in tact. -
json-mask
Tiny language and engine for selecting specific parts of a JS object, hiding the rest. -
Awesome phonenumber parser
Google's libphonenumber pre-compiled with the closure compiler -
strip-json-comments
Strip comments from JSON. Lets you use comments in your JSON files! -
json-query
Retrieves values from JSON objects for data binding -
safe-json-value
โ๏ธ JSON serialization should never fail -
binary-extract
Extract a value from a buffer of json without parsing the whole thing -
parsec ๐
๐ Tiniest body parser in the universe. Built for modern Node.js -
docx-to-pdf-on-AWS-Lambda
Microsoft Word doc/docx to PDF conversion on AWS Lambda using Node.js
SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of strip-css-comments or a related project?
README
strip-css-comments
Strip comments from CSS
Also available as a Gulp/Grunt/Broccoli plugin.
Usage
$ npm install strip-css-comments
Usage
const stripCssComments = require('strip-css-comments');
// By default important comments `/*!` are preserved
stripCssComments('/*! <copyright> */ body { /* unicorns */color: hotpink; }');
//=> '/*! <copyright> */ body { color: hotpink; }'
// `preserve: false` will strip all comments including `/*!`
stripCssComments(
'/*! <copyright> */ body { /* unicorns */color: hotpink; }',
{preserve: false}
);
//=> 'body { color: hotpink; }'
// Preserve comments based on a regex
stripCssComments(
'/*# preserved */ body { /* unicorns */color: hotpink; }',
{preserve: /^#/}
);
//=> '/*# preserved */ body { color: hotpink; }'
// Preserve comments based on the return value of the supplied function
stripCssComments(
'/*# preserved */ body { /* unicorns */color: hotpink; }',
{
preserve: comment => comment.charAt(0) === '#'
}
);
//=> '/*# preserved */ body { color: hotpink; }'
API
stripCssComments(cssString, options?)
cssString
Type: string
String with CSS.
options
Type: object
preserve
Type: boolean | RegExp | Function
\
Default: true
true
- Preserve important comments/*! */
.false
- Strip all comments.RegExp
- Preserve comments where the comment body matches a regular expression.Function
- Preserve comments for which a function returnstrue
. The function is called on each comment, gets the comment body as the first argument, and is expected to return a boolean of whether to preserve the comment.
whitespace
Type: boolean
\
Default: true
Replace comments with whitespace instead of stripping them entirely.
Benchmark
$ npm run bench
Related
- strip-css-comments-cli - CLI for this module
- strip-json-comments - Strip comments from JSON