Registry / serialization / cssafe

cssafe

JSON →
library0.0.1jsnpmunverified

A TypeScript-based CSS transpiler that provides type safety for stylesheets. Currently at version 0.0.1 with unknown maturity and release cadence. Differentiates by aiming to catch CSS errors at compile time using TypeScript, unlike traditional CSS preprocessors or runtime solutions.

npm install cssafe
INSTALL
IMPORT
SIG · CSSAFE
C
cssafe
serializationjavascriptv0.0.1
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.

cssafe
import cssafe from 'cssafe'
const cssafe = require('cssafe')
Package is ESM-only; CommonJS require may fail.
transpile
import { transpile } from 'cssafe'
import transpile from 'cssafe'
Named export, not default.
CSSafeOptions
import type { CSSafeOptions } from 'cssafe'
import { CSSafeOptions } from 'cssafe'
TypeScript type; use 'import type' to avoid runtime import.

Transpiles a CSS string using cssafe with options.

import cssafe from 'cssafe'; const result = cssafe.transpile(` .foo { color: red; font-size: 16px; } `, { sourcemap: true }); console.log(result.code);
Debug
Known issues
breakingVersion 0.0.1 is a pre-release; API may change without notice.
fix
Pin to specific version and test thoroughly.
affects: 0.0.1
gotchaDefault export is the main entry; named exports may not work if package uses CJS-like export pattern.
fix
Use default import: import cssafe from 'cssafe'
affects: 0.0.1
gotchaNo README available; assumptions about API may be incorrect.
fix
Check source code or contact maintainer for documentation.
affects: 0.0.1
Errors
Common errors & fixes
Error [ERR_MODULE_NOT_FOUND]
Node.js version < 16 or using require instead of import
fix
Upgrade to Node.js >= 16 and use import statements.
Uncaught TypeError: cssafe.transpile is not a function
Importing wrong export or using old version without transpile method
fix
Check import: import cssafe from 'cssafe' then call cssafe.transpile()
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
cssafe — npm install cssafe · libregistry