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

@dieison-depra/nojs-cli-bun

v1.0.0

Published

Official CLI for No.JS — scaffold projects, optimize HTML, run dev server, validate templates, and manage plugins

Readme

NoJS CLI — Bun Edition

Bun-native CLI for the No.JS framework

Scaffold projects, optimize HTML for production, run a dev server with live reload, validate templates, and manage plugins — all from the command line.

This is a Bun fork of ErickXavier/NoJS-CLI. The original project targets Node.js ≥ 18. This fork replaces the entire runtime with Bun — the dev server uses Bun.serve(), the test suite runs on bun:test, spawning uses Bun.spawnSync, and all tooling (biome, knip) is Bun-first. This fork maintains its own feature roadmap and may periodically synchronise with upstream.

Recommended pairing: use this CLI alongside @dieison-depra/nojs-bun, the Bun-native port of the No.JS framework itself.

The CLI is the companion toolchain for No.JS projects. It provides everything you need to go from a blank folder to a production-ready application:

  • Scaffold a new project with an interactive wizard (init)
  • Optimize your HTML output with 26 built-in prebuild plugins (prebuild)
  • Develop locally with a fast file server and live reload (dev)
  • Validate your templates for common No.JS mistakes before shipping (validate)
  • Manage community and official plugins (plugin)

Install

bun install -g @dieison-depra/nojs-cli-bun

Requires Bun >= 1.3.11.


Quick Start

# Create a new project
nojs init my-app
cd my-app

# Start the dev server
nojs dev

# Validate your templates
nojs validate *.html

# Optimize for production
nojs prebuild

Commands

| Command | Alias | Description | |---------|-------|-------------| | nojs init [path] | i | Scaffold a new No.JS project with optional routing, i18n, and API base | | nojs prebuild [dir] | b | Build-time HTML optimization — 26 plugins for performance, SEO, security, and accessibility | | nojs dev [path] | d | Local dev server with live reload (SSE), SPA fallback, colored request logging | | nojs validate [files] | v | Validate No.JS templates against 10 rules (CI-friendly JSON output) | | nojs plugin <action> | p | Manage plugins — search, install, update, remove, list | | nojs help | | Show help | | nojs version | | Show version |


Init

Interactive wizard that generates a ready-to-go No.JS project:

nojs init ./my-app

Non-interactive mode:

nojs init ./my-app --routing --i18n --locales en,pt --api https://api.example.com --yes

Generates index.html, route pages (.tpl), i18n locale files, and a nojs.config.json.


Dev Server

nojs dev              # serve current directory
nojs dev ./docs/      # serve a specific path
nojs dev --port 8080  # custom port
nojs dev --open       # open browser on start
nojs dev --quiet      # suppress request logging
nojs dev --no-reload  # disable live reload

Features: live reload via SSE, SPA fallback (serves index.html for unmatched routes), MIME type detection, path traversal protection.


Prebuild

The prebuild command runs a configurable pipeline of 26 built-in plugins that apply build-time transformations to your HTML files. Plugins are opt-in — enable only what you need in nojs-prebuild.config.js.

nojs prebuild            # process current directory
nojs prebuild ./dist/    # process a specific path

Performance

| Plugin | What it does | |--------|-------------| | inject-resource-hints | Preload/prefetch hints for fetch directives and route templates | | inject-modulepreload | modulepreload hints for ES module scripts | | inject-speculation-rules | Speculation Rules API for near-instant SPA navigation | | optimize-images | Lazy loading, LCP priority, and fetchpriority hints | | inject-view-transitions | @view-transition CSS for smooth same-origin navigation | | inline-critical-css | Inline above-fold CSS, async-load full sheet (requires beasties) | | generate-responsive-images | AVIF/WebP srcset generation (requires sharp) | | precompress-assets | .br and .gz companion files via Bun zlib | | optimize-fonts | Google Fonts preconnect + font-display:swap | | minify-html | Whitespace collapse and comment removal | | inline-svg | Replace <img src="*.svg"> with inline <svg> |

SEO & Metadata

| Plugin | What it does | |--------|-------------| | inject-head-attrs | Inject title, description, and canonical from No.JS page directives | | inject-og-twitter | Open Graph and Twitter Card meta tags | | inject-canonical-url | <link rel="canonical"> from siteUrl config + file path | | generate-sitemap | sitemap.xml from No.JS route definitions | | inject-jsonld | WebPage/WebSite JSON-LD structured data | | audit-meta-tags | Auto-inject charset/viewport, warn on missing title/description/lang |

No.JS Runtime

| Plugin | What it does | |--------|-------------| | inline-animation-css | Inline only the keyframes used by animate= directives | | inject-visibility-css | Hide if=/show=/hide= elements until the runtime processes them | | inject-template-hints | Preload stylesheets and inline skeleton CSS for loading templates |

Security

| Plugin | What it does | |--------|-------------| | inject-csp-hashes | SHA-384 CSP <meta> tag for inline scripts and styles | | inject-sri-hashes | integrity + crossorigin for external scripts and stylesheets | | enforce-script-loading | Add defer/async to third-party scripts |

Quality & Accessibility

| Plugin | What it does | |--------|-------------| | audit-accessibility | WCAG quick-checks: alt text, link names, labels, headings, lang | | purge-unused-css | Remove CSS rules with no matching selectors in the HTML | | generate-pwa-manifest | manifest.webmanifest + manifest link tag |


Configuration

Create nojs-prebuild.config.js in your project root:

// nojs-prebuild.config.js
export default {
  plugins: {
    'inject-resource-hints': true,
    'inject-head-attrs': true,
    'inject-og-twitter': true,
    'generate-sitemap': { siteUrl: 'https://example.com' },
    'inject-canonical-url': { siteUrl: 'https://example.com' },
    'minify-html': true,
    'optimize-images': true,
    'inject-view-transitions': true,
  },
};

Validate

nojs validate *.html
nojs validate src/ --format json   # JSON output for CI

Rules: missing as on fetch, each without in, foreach without from, model on non-form elements, bind-html warning, routes without route-view, empty event handlers, loops without key, duplicate store names, validate outside <form>.


Plugin Manager

Hybrid plugin manager — CDN for official plugins, npm for community packages:

nojs plugin search analytics
nojs plugin install @nojs/analytics
nojs plugin list
nojs plugin update @nojs/analytics
nojs plugin remove @nojs/analytics

CDN plugins get SRI integrity hashes (sha384) computed automatically.


Writing Your Own Plugin

Plugins are plain ES modules:

// my-plugin.js
export default {
  name: 'my-plugin',
  description: 'Does something useful.',

  async process(html, { filePath, config, allFiles }) {
    // transform html string and return it
    return html;
  },

  // optional — called once after all files are processed
  async finalize({ outputDir, config, processedFiles }) {},
};

See docs/prebuild/creating-plugins.md for the full plugin development guide.


Documentation

| Guide | Description | |-------|-------------| | Getting Started | Installation, first project, basic workflow | | Commands Reference | All CLI commands in detail | | Prebuild Plugins | Full reference for all 26 built-in plugins | | Creating Plugins | How to write and distribute custom plugins | | Configuration | Config file reference | | Dependency Analysis | Security risk and replaceability review |


Architecture

bin/nojs.js                     ← executable entry point
src/
  cli.js                        ← command dispatcher
  commands/                     ← thin command wrappers
  init/generator.js             ← project scaffold
  dev/server.js                 ← HTTP server + SSE live reload
  validate/rules.js             ← template validation rules
  plugin/manager.js             ← plugin install/remove
  prebuild/
    runner.js                   ← plugin pipeline orchestrator
    config.js                   ← config loader
    html.js                     ← HTML file utilities
    plugins/                    ← 26 built-in plugins
__tests__/                      ← bun:test unit tests

Zero production dependencies (except linkedom for HTML parsing). Everything else uses Bun built-ins.


Ecosystem

Bun Edition (this fork)

| Tool | Description | |------|-------------| | @dieison-depra/nojs-bun | No.JS framework — Bun-native port ⭐ recommended pairing | | @dieison-depra/nojs-cli-bun | This package — Bun-native CLI |

Original (Node.js)

| Tool | Description | |------|-------------| | No.JS | The HTML-first reactive framework (original) | | NoJS-CLI | Original Node.js CLI (upstream of this fork) | | NoJS-LSP | VS Code extension — autocomplete, hover docs, diagnostics | | NoJS-MCP | MCP server — AI tools for building No.JS apps |


Contributing

Contributions are welcome! Please read the Contributing Guide and our Code of Conduct before submitting a PR.

License

MIT © Erick Xavier