{"id":25999,"library":"node-cssql","title":"node-cssql","description":"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.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install node-cssql","lang":"bash","label":"npm"},{"cmd":"yarn add node-cssql","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-cssql","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS only; no ESM export available.","symbol":"cssql","correct":"const { cssql } = require('node-cssql');"},{"note":"No default export; only named export { cssql } exists.","wrong":"import cssql from 'node-cssql';","symbol":"default"}],"quickstart":{"code":"const { cssql } = require('node-cssql');\nconst path = require('path');\nconst input = path.join(__dirname, 'styles.cssql');\nconst output = path.join(__dirname, 'styles.css');\n// Create a sample .cssql file if it doesn't exist\nconst fs = require('fs');\nif (!fs.existsSync(input)) {\n  fs.writeFileSync(input, `\nCREATE SELECTOR .my-class;\nINSERT .my-class (color, red);\nINSERT .my-class (font-size, 16px);\n`);\n}\ncssql(input, output);\nconsole.log('CSS generated at', output);","lang":"javascript","description":"Shows basic usage: create a .cssql file, then transpile it to .css using the cssql function."},"warnings":[{"fix":"Do not use in production; consider using standard CSS or a preprocessor like SASS.","message":"The package is a joke/novelty; CSSQL syntax is intentionally more verbose than CSS.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Be aware of large node_modules size; evaluate if this is acceptable.","message":"The transpiler is written in Haskell and bundled via GHCJS; transitive dependency size may be large.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use const { cssql } = require('node-cssql'); instead of import.","message":"Only CommonJS require() is supported; ESM import will fail.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install node-cssql' in your project root.","cause":"Package not installed correctly or missing from node_modules.","error":"Error: Cannot find module 'node-cssql'"},{"fix":"Use const { cssql } = require('node-cssql');","cause":"Incorrect import: using default import instead of destructured require.","error":"TypeError: cssql is not a function"},{"fix":"Use require() or convert your project to CommonJS.","cause":"Attempting to use ESM import with a CommonJS-only package.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}