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

@webjsdev/core

v0.7.26

Published

webjs core runtime - html/css tags, WebComponent base, isomorphic renderers

Readme

@webjsdev/core

Isomorphic core runtime for webjs, the AI-first, web-components-first, no-build web framework.

This package ships the tagged-template html / css helpers, the WebComponent base class, the client and server renderers (with Declarative Shadow DOM support), directives, context protocol, the Task controller, and the client-side navigation router.

Not intended for direct install. You'll usually get it as a transitive dep when you scaffold an app with @webjsdev/cli.

Install

npm install @webjsdev/core

Use

import { html, css, WebComponent } from '@webjsdev/core';

class Counter extends WebComponent({ count: Number }) {
  static styles = css`button { padding: 8px 12px; }`;

  render() {
    return html`<button @click=${() => this.count++}>${this.count}</button>`;
  }
}
Counter.register('x-counter');

Class.register('tag-name') is the webjs idiom. It calls customElements.define() under the hood and adds tag validation, registry bookkeeping (needed for lazy-loading), and a dev-time double-register warning. Plain customElements.define('x-counter', Counter) works identically.

Side-channel imports for optional features:

import { unsafeHTML } from '@webjsdev/core/directives';
import { createContext } from '@webjsdev/core/context';
import { Task } from '@webjsdev/core/task';

See the full framework docs at https://github.com/webjsdev/webjs.

Layout in the tarball

The tarball ships both src/ and dist/. The browser fetches the framework as ONE self-contained bundle, dist/webjs-core-browser.js, instead of waterfalling through 15+ source files or a fan of code-split chunks. That single file re-exports the whole browser surface (html, render, WebComponent, the client router, directives, context, task, signals), so the @webjsdev/core, /directives, /context, /task, and /client-router specifiers all resolve to it and each import picks its named exports. splitting is off, so there are no chunk-*.js. The only other browser file is dist/webjs-core-lazy-loader.js, fetched on-demand for static lazy = true components. SSR / Node resolve the full surface via the package exports default. The readable src/ stays on disk so AI agents can grep it directly.

The bare @webjsdev/core specifier resolves to a BROWSER-only entry (dist/webjs-core-browser.js in production, index-browser.js in source-mode dev). The browser entry drops the server-only render-server.js (~1.1k lines) and the setCspNonceProvider setter so server bytes never ride the wire. Node-side consumers resolve via the package's default condition and land on index.js, which keeps the full surface for the SSR pipeline and unit tests. renderToString and renderToStream are also available at the explicit @webjsdev/core/server subpath.

The bundle is built ONCE at npm publish time on the author's machine via esbuild as a publish-time devDependency. User installs never invoke a bundler. If you install the package via a git dependency (npm install github:webjsdev/webjs), the prepare lifecycle runs on your machine to produce the bundle; esbuild is in devDependencies so it's available for that case.

License

MIT