Registry / serialization / node-cssql

node-cssql

JSON →
library1.0.2jsnpmunverified

A JavaScript wrapper for the CSS in SQL Transpiler (cssql), which allows users to write CSS using SQL-like DDL syntax (CREATE SELECTOR, INSERT, MERGE, etc.) that is then transpiled into standard CSS. The transpiler itself is written in Haskell and distributed via GHCJS. Version 1.0.2 is the latest stable release. This package is a novelty/educational project that intentionally makes CSS more verbose and less readable. It provides a Node API with a single function `cssql(inputFile, outputFile)`. Not recommended for production use.

npm install node-cssql
INSTALL
IMPORT
SIG · NODE-CSSQL
N
node-cssql
serializationjavascriptv1.0.2
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.

cssql
const { cssql } = require('node-cssql');
CommonJS only; no ESM export available.
default
import cssql from 'node-cssql';
No default export; only named export { cssql } exists.

Shows basic usage: create a .cssql file, then transpile it to .css using the cssql function.

const { cssql } = require('node-cssql'); const path = require('path'); const input = path.join(__dirname, 'styles.cssql'); const output = path.join(__dirname, 'styles.css'); // Create a sample .cssql file if it doesn't exist const fs = require('fs'); if (!fs.existsSync(input)) { fs.writeFileSync(input, ` CREATE SELECTOR .my-class; INSERT .my-class (color, red); INSERT .my-class (font-size, 16px); `); } cssql(input, output); console.log('CSS generated at', output);
Debug
Known issues
gotchaThe package is a joke/novelty; CSSQL syntax is intentionally more verbose than CSS.
fix
Do not use in production; consider using standard CSS or a preprocessor like SASS.
affects: >=0.0.0
gotchaThe transpiler is written in Haskell and bundled via GHCJS; transitive dependency size may be large.
fix
Be aware of large node_modules size; evaluate if this is acceptable.
affects: >=0.0.0
gotchaOnly CommonJS require() is supported; ESM import will fail.
fix
Use const { cssql } = require('node-cssql'); instead of import.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'node-cssql'
Package not installed correctly or missing from node_modules.
fix
Run 'npm install node-cssql' in your project root.
TypeError: cssql is not a function
Incorrect import: using default import instead of destructured require.
fix
Use const { cssql } = require('node-cssql');
SyntaxError: Unexpected token 'export'
Attempting to use ESM import with a CommonJS-only package.
fix
Use require() or convert your project to CommonJS.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
node-cssql — npm install node-cssql · libregistry