node-cssql
raw JSON → 1.0.2 verified Fri May 01 auth: no javascript
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.
Common errors
error Error: Cannot find module 'node-cssql' ↓
cause Package not installed correctly or missing from node_modules.
fix
Run 'npm install node-cssql' in your project root.
error TypeError: cssql is not a function ↓
cause Incorrect import: using default import instead of destructured require.
fix
Use const { cssql } = require('node-cssql');
error SyntaxError: Unexpected token 'export' ↓
cause Attempting to use ESM import with a CommonJS-only package.
fix
Use require() or convert your project to CommonJS.
Warnings
gotcha The 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.
gotcha The 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.
gotcha Only CommonJS require() is supported; ESM import will fail. ↓
fix Use const { cssql } = require('node-cssql'); instead of import.
Install
npm install node-cssql yarn add node-cssql pnpm add node-cssql Imports
- cssql
const { cssql } = require('node-cssql'); - default wrong
import cssql from 'node-cssql';correctInternal server error