CSS Parser/Stringifier
JSON →The `css` package is a fundamental JavaScript library designed for robust parsing and stringifying of Cascading Style Sheets (CSS). It serves as a core component for various CSS processing tools, including preprocessors, postprocessors, and linting utilities. At its current stable version, 3.0.0, it offers `css.parse()` to convert raw CSS strings into a detailed Abstract Syntax Tree (AST) object, and `css.stringify()` to transform such an AST back into a minified or formatted CSS string. The library provides comprehensive options for error handling, including a 'silent' mode for collecting parsing errors without throwing, and extensive support for source map generation to maintain traceability between original and processed CSS. Its primary differentiator lies in its adherence to the reworkcss AST specification, offering a consistent and manipulable representation of CSS for complex transformations. While the provided documentation highlights CommonJS usage, modern projects might explore ESM compatibility, though it's not explicitly documented in the given excerpt. The project generally follows semantic versioning without a fixed release cadence.
Traffic · last 30 days ↑0% vs prev 7d
top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany