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

@aero-js/core

v0.3.3

Published

The core package of the Aero static site generator. It provides the compiler, runtime, and Vite plugin that power Aero’s HTML-first template engine, component system, and build pipeline.

Downloads

113

Readme

@aero-js/core

The core package of the Aero static site generator. It provides the compiler, runtime, and Vite plugin that power Aero’s HTML-first template engine, component system, and build pipeline.

Overview

  • Compiler — Parses Aero HTML templates, extracts script blocks, and compiles templates into async render functions (DOM → IR → JS).
  • Runtime — Renders pages and components with context; supports props, slots, globals, and 404 handling.
  • Vite plugin — Integrates templates into the Vite build: virtual client modules, HMR, static generation, optional Nitro and image optimization.

Exports

| Export | Description | | ---------------------------------- | -------------------------------------------------------------------- | | @aero-js/core | Default: shared aero instance with mount() for the client entry. | | @aero-js/vite | aero() Vite plugin for build and dev. (Re-exported from core.) | | @aero-js/core/runtime | Aero class for programmatic rendering. | | @aero-js/core/runtime/instance | Shared aero instance and onUpdate for HMR. | | @aero-js/core/types | Shared TypeScript types. |

Script taxonomy

Script blocks are classified by attributes (see docs/script-taxonomy.md in the repo):

| Script type | Attribute | When it runs | Notes | | ----------- | ---------------------- | ----------------- | ----------------------------------------------------------------------------------------- | | Build | <script is:build> | Build time (Node) | One per template; compiles into the render module. Access aero.props, globals, imports. | | Client | Plain <script> | Browser | Bundled as a Vite virtual module; HMR. Use pass:data to inject build-time data. | | Inline | <script is:inline> | Browser | Left in place; not bundled. For critical inline scripts (e.g. theme FOUC prevention). | | Blocking | <script is:blocking> | Browser | Extracted and emitted in <head>. |

Features

Template compiler

  • Parses templates and extracts <script is:build>, client (plain <script>), <script is:inline>, and <script is:blocking> blocks.
  • Lowers template DOM to an IR (intermediate representation), then emits a single async render function with { } interpolation.
  • Supports components, slots, each, if / else-if / else, and pass:data on scripts and styles.

Example

<script is:build>
	import header from '@components/header'
	const { title } = aero.props
</script>
<header-component title="{ title }" />

Runtime

  • Aero class: global(), registerPages(), render(), renderComponent().
  • Context includes globals (e.g. from content), props, slots, request, url, params.
  • Resolves pages by name with fallbacks (index, trailing slash, getStaticPaths); returns null for 404 when no static path matches.

Example

import { Aero } from '@aero-js/core/runtime'
const aero = new Aero()
aero.global('site', { title: 'My Site' })
// … registerPages, then:
const html = await aero.render('index', { props: { title: 'Home' } })

Vite plugin

  • Plugin from @aero-js/vite: aero(options?). Options: server, apiPrefix, dirs, site (canonical URL; exposed as import.meta.env.SITE and Aero.site; when set, generates dist/sitemap.xml after build).
  • Sub-plugins: config resolution, virtual client modules (\0-prefixed), HTML transform, SSR middleware, HMR.
  • Build: page discovery, static render, optional Nitro build, optional image optimizer (sharp/svgo).

Example

import { aero } from '@aero-js/vite'
export default {
	plugins: [aero({ server: true })],
}

Apps typically use @aero-js/config and createViteConfig(aeroConfig), which wires the Aero plugin for them.

Client entry

The default export of @aero-js/core is the shared aero instance with mount(options?) attached. Use it as the browser entry (e.g. in your main script). It does not perform an initial render; it attaches to a root element and subscribes to HMR re-renders in dev.

import aero from '@aero-js/core'
aero.mount({
	target: '#app',
	onRender: el => {
		/* optional */
	},
})

Components and layouts

  • Components: use -component suffix in markup; import without suffix (e.g. @components/headerheader.html).
  • Layouts: use -layout and <slot> (with name and optional slot attribute).
  • Props: attributes or props / props="{ ... }". In build script, read via aero.props.

Path aliases and client stack

  • Path aliases (e.g. @components/*, @layouts/*, @content/*) are resolved from the project tsconfig.
  • Alpine.js and HTMX attributes (e.g. x-data, :disabled, hx-post) are preserved; attributes matching ^(x-|[@:.]).* are not interpolated.

File structure

src/
  compiler/     # parser.ts, codegen.ts, ir.ts, emit.ts, resolver.ts, helpers.ts, constants.ts
  runtime/      # index.ts (Aero), instance.ts, client.ts
  vite/         # index.ts (plugin), build.ts, defaults.ts
  utils/        # aliases.ts, routing.ts
  types.ts
  index.ts      # client entry (aero + mount)

Tests

Vitest in packages/core: compiler/__tests__/, runtime/__tests__/, vite/__tests__/. Run from repo root: pnpm test.