Registry / serialization / css-stringify

css-stringify

JSON →
library2.0.0jsnpmunverified

A JavaScript CSS stringifier for Node.js, part of the Rework CSS ecosystem. It takes an AST produced by css-parse and converts it back to a CSS string. Version 2.0.0 is the latest stable release, compatible with Node.js. Typically used internally via the `css` package. Not actively developed, but stable for legacy projects.

npm install css-stringify
INSTALL
IMPORT
SIG · CSS-STRINGIFY
C
css-stringify
serializationjavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

stringify
import { stringify } from 'css-stringify';
import stringify from 'css-stringify';
Named export, not default. Also exposed via require: const { stringify } = require('css-stringify');

Parses a CSS string to AST using css-parse, then stringifies it back to CSS using css-stringify.

import { stringify } from 'css-stringify'; import { parse } from 'css-parse'; const css = 'body { color: red; }'; const ast = parse(css); const output = stringify(ast); console.log(output); // prints: body { color: red; }
Debug
Known issues
gotchaPackage is deprecated in favor of the combined 'css' package. Direct usage is uncommon.
fix
Use the 'css' package which re-exports stringify: import { stringify } from 'css';
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: stringify is not a function
Using default import instead of named import.
fix
import { stringify } from 'css-stringify';
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
css-stringify — npm install css-stringify · libregistry