Registry / devops / csiynj

csiynj

JSON →
library1.0.0jsnpmunverified

A lightweight TypeScript-based transpiler that converts a JavaScript-like syntax (JSCSS) into standard CSS, enabling developers to define styles inline using JSON-style objects. Version 1.0.0 is the initial release. The tool features class scoping, variable interpolation, and advanced selectors like getbyid. It enforces ultra-strict TypeScript compilation with runtime guards against undefined index accesses. Differentiators include type safety, no external CSS files, and inline style definition using JSON.

npm install csiynj
INSTALL
IMPORT
SIG · CSIYNJ
C
csiynj
devopsjavascriptv1.0.0
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.

transpileJSCSS
import { transpileJSCSS } from 'csiynj'
const transpileJSCSS = require('csiynj').transpileJSCSS
Package is ESM-only, no CommonJS support.
JSCSSParser
import { JSCSSParser } from 'csiynj'
import JSCSSParser from 'csiynj'
JSCSSParser is a named export, not default.
getbyid
import { getbyid } from 'csiynj'
import { getByID } from 'csiynj'
Case-sensitive; export is all lowercase.

Demonstrates converting a simple JSCSS string with a class and variable interpolation into CSS output.

import { transpileJSCSS } from 'csiynj'; const jscss = ` const brandColor = "purple"; defclass card = { "div": { "background": "white", "color": brandColor } } `; const css = transpileJSCSS(jscss); console.log(css); // Output: // .card div { // background: white; // color: purple; // }
Debug
Known issues
gotchaPackage requires strict tsconfig flags (strict, noUncheckedIndexedAccess, verbatimModuleSyntax). Not setting these causes runtime errors.
fix
Add 'strict', 'noUncheckedIndexedAccess', and 'verbatimModuleSyntax' to tsconfig.json.
affects: >=1.0.0
gotchaNo CommonJS support; require() will fail with ERR_REQUIRE_ESM.
fix
Use ES module imports or set 'type': 'module' in package.json.
affects: >=1.0.0
gotchaThe getbyid syntax uses double brackets, which may confuse linters or typescript.
fix
Ensure no trailing comma in bracket syntax; e.g., getbyid['main-title'] not getbyid['main-title',].
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading '0')
Transpiler encounters malformed JSCSS syntax, e.g., missing closing quote.
fix
Validate JSCSS syntax: ensure all keys and strings are properly quoted and closed.
ERR_REQUIRE_ESM: require() of ES Module not supported
Using require() to import csiynj in a CommonJS context.
fix
Use import syntax or set 'type': 'module' in your package.json.
TS2322: Type 'undefined' is not assignable to type 'string'
Missing tsconfig strict flags that enable indexed access checks.
fix
Set 'strict': true or 'noUncheckedIndexedAccess': true in tsconfig.json.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
typescriptoptionalRequired for type-checking and compilation under strict compiler flags
Agent activity
6 hits · last 30 days
node
6
Resources
packagecsiynj
csiynj — npm install csiynj · libregistry