npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

csiynj

v1.0.0

Published

Use CSS without an external CSS file. use JSON in JS instead.

Readme

JSCSS Transpiler

A fast, lightweight, and type-safe transpiler that transforms JSCSS syntax into standard browser-readable CSS. Built with modern TypeScript using ultra-strict compilation profiles.

✨ Features

  • Define Styles via JS: Clear declarative layout mappings for your UI elements.
  • Variable Interoperability: Support for build-time compilation resolution of custom standard constants.
  • Class Component Scoping: Target multi-nested layouts using defclass.
  • Advanced Query Selection: Expressive syntax hooks including .getbyid["..."] and sub-tag child selections natively.

🚀 Syntax Overview

JSCSS Code (styles.jscss)

const brandColor = "purple";

defclass card = {
  "div": {
    "background": "white",
    "color": brandColor
  }
}

elementStyle h2.getbyid["main-title"] = {
  "font-size": "24px"
}

elementStyle div.span = {
  "display": "block"
}

Compiled CSS Output (styles.css)

.card div {
  background: white;
  color: purple;
}

h2#main-title {
  font-size: 24px;
}

div span {
  display: block;
}

📦 Installation

Ensure you have your modern Node environment set up, then configure your workspace dependencies:

# Initialize project
npm init -y

# Install compilation toolchains
npm install -D typescript @types/node

🛠️ Configuration

This engine is built to run under highly strict type conditions. Ensure your project's tsconfig.json contains the following flags:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "nodenext",
    "moduleResolution": "nodenext",
    "rootDir": "./src",
    "outDir": "./dist",
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "verbatimModuleSyntax": true
  }
}

💻 Usage

1. The Core Module (src/transpiler.ts)

Add the core compilation logic to your source folder. It exports a type-safe function:

import { transpileJSCSS } from './transpiler.js';

const code = `const color = "red"; defclass custom = { "p": { "color": color } }`;
const cssOutput = transpileJSCSS(code);

console.log(cssOutput);

2. Compile Project

Build your code down to standardized production JavaScript using the native compiler CLI tool:

npx tsc

3. Run Executable Output

Execute your build artifact directly inside standard environments using Node:

node dist/index.js

🔒 Type Safety Features

This project utilizes advanced compile-time validations to secure the tokenizer array iterations against memory runtime corruption bugs:

  • Index Narrowing Guardrails: Explicit type guards block undefined access paths from regex results.
  • Dictionary Check Profiles: Implements strict dictionary indexation tracking structures.