A decent, non-validating CSS parser and stringifier. Current stable version is 0.3.4 (last release 2015-04-02, now in maintenance mode). Provides parse, stringify, and lex functions with support for comments and position tracking. Unlike validating parsers, mensch handles malformed CSS (mis-matched braces, missing semi-colons) without error. Differentiators: comments in AST, position info, and lenient parsing. Alternatives: PostCSS, css, csstree.
npm install menschVerified import paths — ran on the pinned version, not inferred.
Parse a CSS string with comments and positions, then stringify with indentation.
Use a validating parser (e.g., PostCSS with stylelint) if validation is needed.
Keep comments only between rules or declarations.
Consider using PostCSS or csstree for modern CSS parsing.
Update to v0.3.4 or later.
Use const mensch = require('mensch'); or import * as mensch from 'mensch'.Use import mensch from 'mensch'; then mensch.parse().
Run npm install mensch and ensure correct casing.
Switch to a modern parser like PostCSS.
No dependency data recorded yet.