Fast where
it matters.
A fast Go CSS engine behind a PostCSS-compatible JavaScript surface. The Go core owns the hot path; Node and browser packages own ecosystem integration.
Go owns the data path Parse, AST mutation, plugin visitors, stringify, warnings, and source maps run in the native engine.
A narrow native boundary Node uses a compact binary AST over Node-API; WASM keeps its Worker message contract.
JavaScript owns the ecosystem surface Config, plugins, and PostCSS-shaped results stay in Node; Go also owns the parse-free no-work map path.
Package boundaries
Each layer owns one part of the runtime contract, keeping the native engine independent from host-specific integration.
| Layer | Responsibility |
|---|---|
| Go engine | Parse, AST mutation, plugin visitors, stringify, warnings, and source maps. |
| Node service | Native addon loading, Node-API async work, synchronous calls, option normalization, and result handling. |
| JavaScript compatibility | Config, JS plugins, message combining, and PostCSS-shaped results. Map options are normalized in @postcss-go/shared; Go owns map generation, previous maps, and annotations. |
| WASM service | Same service contract as Node, via a Worker and Go WASM. |
Hybrid request flow
JavaScript owns config, plugins, and PostCSS-shaped results. One request crosses the bridge into Go for parse, AST work, and stringify, then returns with CSS, map, messages, and AST.
| Module | Responsibility |
|---|---|
| service | Shared async service contract. |
| native | Node-API async/sync operations, compact AST codec, and option normalization. |
| browser | Worker-backed service; @postcss-go/wasm ships the WASM assets. |
| cli | Config, JS plugins, message combining, and writing Go-generated CSS and maps. |