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

@fabudde/nyxcode

v0.39.2

Published

NyxCode — The AI-native programming language. One .nyx file = full-stack app. 3.5x fewer tokens than Next.js.

Downloads

16,331

Readme

🦞 NyxCode

The AI-native programming language. One .nyx file = full-stack app.

npm Tests License: MIT

🌐 nyxcode.io · 📊 NyxStatus.com (built in 378 lines of NyxCode)


Why NyxCode?

AI writes most code in 2026 — but still thinks in React, Vue, and raw HTML. Every token costs money, time, and context window.

NyxCode: 3.5x fewer tokens than Next.js. 71% cheaper AI generation.

| | NyxCode | Next.js | Savings | |---|---------|---------|---------| | Lines | 378 | 1,069 | 65% fewer | | Files | 1 | 27 | 27x fewer | | Tokens | ~2,733 | ~9,476 | 3.5x fewer | | AI cost | ~$0.20 | ~$0.71 | 71% cheaper |

Real benchmark: NyxStatus.com — identical full-stack SaaS, measured with cl100k_base.

Quick Start

npm i -g @fabudde/nyxcode
nyx build app.nyx -o dist/        # Static site
nyx build app.nyx                 # Full-stack (auto-detects tables/api)
nyx dev app.nyx                   # Dev server + hot reload
nyx add stripe                    # Add package + npm install

Full-Stack in 16 Lines

table posts { title text required, body text, created auto }
security { table users, login email password, token jwt, protect /api/posts write }
theme { colors { primary #667eea, bg #0a0a12, card #1a1a2e } }
preset card { bg card, r 12px, p 2rem }

page / {
  section style={ mw 800px, mx auto, p 2rem } {
    h1 "My Blog"
    form /api/posts auth { input title, submit "Post", success -> reload }
    data posts = get /api/posts auth
    each posts -> div preset=card { h3 .title, p .body }
  }
}
page /register {
  form /api/auth/register { input email, input password, submit "Register", success -> redirect / }
}

This generates: index.html, register/index.html, AND server.js (10 CRUD endpoints + JWT auth + SQLite). Zero config.

React vs NyxCode

React — 20+ lines:

import React, { useState, useEffect } from 'react';
export default function UserList() {
  const [users, setUsers] = useState([]);
  useEffect(() => {
    fetch('/api/users').then(r => r.json()).then(setUsers);
  }, []);
  return (
    <div className="container">
      {users.map(u => (
        <div key={u.id} className="card">
          <h3>{u.name}</h3><p>{u.email}</p>
        </div>
      ))}
    </div>
  );
}

NyxCode — 4 lines:

page /users {
  data users = get /api/users
  each users -> card { h3 .name, p .email }
}

Same result. 76% fewer lines. 68% fewer tokens.

v0.30.0 — The Language Release 🔥

NyxCode is now a programming language, not just a DSL. New backend primitives:

let — Variable Bindings

api GET /api/stats auth {
  let users = query "SELECT COUNT(*) as n FROM users"
  let posts = query "SELECT COUNT(*) as n FROM posts"
  respond 200 { status "ok" }
}

let — Reactive Page-Local Variables (v0.33.0)

page '/counter' {
  let count = 0
  let name = "Nyx"
  const label = "Counter"

  h1 "Hello ${name}!"
  p "${label}: ${count}"
  button "+" @click { count += 1 }
}

let in pages/components creates reactive variables — changes auto-update the DOM. const is compile-time inlined with zero runtime cost.

action — Reusable Server Functions

action sendWelcome(email) {
  email to=email subject="Welcome!" body="Thanks for joining."
  on error { respond 500 { error "Email failed" } }
}

on — Table Lifecycle Events

on users.created {
  email to=row.email subject="Welcome!" body="You're in!"
}

env — Environment Variables

env {
  DATABASE_URL required
  STRIPE_KEY required
  DEBUG default="false"
}

email — First-Class Email

email to=user.email subject="Order confirmed" body="Your order is ready."

use — Three-Tier Package System

use stripe           # Tier 1: built-in adapter (auto-init from env)
use nodemailer       # Tier 1: SMTP + sendEmail() helper
use npm:"slugify"    # Tier 2: raw npm require (warning)

every — Background Workers

every 60s 'health-check' {
  query "SELECT id, url FROM monitors"
  fetch $row.url
}

pipe — Declarative Logic Chains (v0.32.0)

pipe 'new-order' {
  on api POST /api/orders auth
  validate $body.email is email
  validate $body.total is number min=1
  query "INSERT INTO orders (email, total) VALUES ($body.email, $body.total)" as result
  set order_id = $result.lastInsertRowid
  notify email to=$body.email subject="Order #$order_id"
  log "Order $order_id created"
  respond 201 { id: $order_id, status: created }
}

16 steps: validate, query, fetch, set, transform, each, when, on change, notify (email/sms/webhook), log, respond, abort, run pipe. Parameterized SQL, webhook security, state detection. See NYXCODE.md.

Multi-Query API Blocks

api POST /api/monitors/delete auth {
  query "DELETE FROM checks WHERE monitor_id = $id"
  query "DELETE FROM alerts WHERE monitor_id = $id"
  query "DELETE FROM monitors WHERE id = $id AND user_id = $req.user.id"
}

Forms Inside each Loops

each alerts -> alert {
  form "/api/alerts/delete" auth {
    input id hidden value=.id
    submit "✕" preset=btn-delete
    success -> reload
  }
}

Backend Auto-Detection

No flags. If your .nyx has table/api/action/security/use/on/env/every/pipeserver.js generated. Otherwise → HTML only.

Features

🎨 Design System

theme {
  colors { primary #667eea, bg #0a0a12 }
  fonts { body Inter, source: google }
  body { bg #0a0a12, c #f0eaff }
  selection { bg rgba(155,142,196,0.3) }
  defaults { a { c primary, td none } }
}
preset card { bg surface; r 12px; p 2rem }

⚡ Animations

keyframes drift {
  0%, 100% { tf translate(0, 0) }
  50% { tf translate(-2%, 1.5%) }
}

📱 Responsive

div grid=3@1 gap=2rem { ... }     # 3 cols desktop, 1 col mobile
nav burger brand="MySite" { ... }  # Accessible mobile menu, zero JS
style { @mobile { fs 0.9rem } }    # Built-in breakpoints

🧩 Components

component Card(title, desc, status="Active") {
  div preset=card {
    h3 "${title}"
    p "${desc}"
    span "${status}"
  }
}
page / { use Card("Hello", "World") }

🔐 Auth & Security

security { table users, login email password, token jwt, protect /api/posts write }
page /dashboard auth { ... }           # Auto-redirect if not logged in
a "Login" visible=guest                # Show only when logged out
a "Dashboard" visible=auth             # Show only when logged in

📊 Data Binding

data posts = get /api/posts auth {
  loading -> p "Loading..."
  empty -> p "No posts yet"
  error -> p "Something went wrong"
}
each posts -> div { h3 .title, img src=.image alt=.title }

🗃️ Database + Auto-Migrations

table posts {
  title text required
  body text
  author [users]         # Foreign key → auto JOIN
  created auto
  category text default="general"   # Add columns anytime — auto-migrated!
}
# Auto-generates: GET/POST/PUT/DELETE endpoints + pagination + search + filtering
# Auto-migrates: New columns applied at startup, zero data loss

🎯 Native Icons (v0.31.0)

theme { icons: lucide }                           # Lucide, Phosphor, or Tabler
icon "heart" size=24                               # Standalone icon
icon "stethoscope" size=32 style={ c #2a7d5f }    # With style
h1 "icon:map-pin Our Location"                     # Inline in text

CSS Shorthands

| Short | CSS | Short | CSS | |-------|-----|-------|-----| | bg | background | c | color | | m / p | margin / padding | mx / px | margin-inline / padding-inline | | w / h | width / height | mw / mh | max-width / max-height | | fs | font-size | fw | font-weight | | r | border-radius | shadow | box-shadow | | d | display | pos | position | | op | opacity | cur | cursor | | td | text-decoration | ta | text-align | | tr | transition | tf | transform | | ai | align-items | jc | justify-content |

Full list (100+ shorthands) →

Architecture

.nyx → Lexer → Parser → AST → Compiler → HTML + CSS + JS
                                        → Express + SQLite (if backend detected)
  • Lexer — Keyword detection, hex colors, strings, comments
  • Parser — Recursive descent, typed AST with 40+ node types
  • Compiler — Scoped CSS, HTML emission, reactive JS codegen
  • Backend Compiler — Express routes, SQLite CRUD, JWT auth, background workers
  • CLIbuild, dev, parse, flatten, add, theme import

NyxStatus — The Proof

378 lines. One file. Full SaaS.

nyxstatus.com — Uptime monitoring with JWT auth, SQLite DB, CRUD API, background health checks, email alerts, cascade deletes, responsive dark theme. 100% NyxCode.

Design Principles

  1. Token Economy — Every character earns its place
  2. One Language — Author writes only NyxCode
  3. Convention over Configuration — Sane defaults, escape hatches when needed
  4. Single-Word Keywords — No compound keywords, ever
  5. Secure by Default — Prepared statements, escaped output, rate limiting
  6. The Golden Rule — If it's not shorter than JS, it shouldn't exist in NyxCode

Versions

| Version | Highlights | |---------|------------| | v0.32.0 | pipe — Declarative Logic Chains — 16 step types, parameterized SQL, webhook security, state detection, pipe-to-pipe | | v0.30.0 | The Language Releaselet, action, on, env, email, use, respond, forms in each, multi-query API | | v0.27.x | page auth, visible=auth/guest, $param.id, every, pagination, search | | v0.26.x | mask-* auto-prefix, compile-time when, picture/source, security hardening | | v0.25.x | Body styles, keyframes, ::selection, element defaults — all native | | v0.24.x | Burger nav, multi-file imports, Figma token import, nyx flatten | | v0.23.x | Theme composition, numeric-prefix keys | | v0.22.x | Full design token system, dark mode | | v0.20.x | Component syntax with ${} interpolation | | v0.1.0 | Genesis |

Created By

Fabian Budde 🐻 — Creator & Language Design Nyx 🦞 — Lead Developer & Compiler Engineering — @NyxTheLobster Tyto 🦉 — Architecture & Security Review — @heyTyto Kiro 🐺 — QA & Technical Documentation

A human and three AIs building the language that bridges both worlds.

License

MIT


NyxCode v0.30.0 — 365 tests — npmNYXCODE.md (full AI context file) — nyxstatus.com

🦞