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/content

v0.3.3

Published

Content collections for Aero: load Markdown (and other files) with frontmatter, validate with Zod, and render to HTML. Powers the `aero:content` virtual module and optional content plugin.

Readme

@aero-js/content

Content collections for Aero: load Markdown (and other files) with frontmatter, validate with Zod, and render to HTML. Powers the aero:content virtual module and optional content plugin.

Exports

| Export | Description | | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | @aero-js/content | defineCollection, defineConfig, render; types ContentDocument, ContentMeta, ContentCollectionConfig, ContentConfig. | | @aero-js/content/vite | aeroContent(options?) Vite plugin. | | @aero-js/content/markdown | Markdown/remark utilities (used internally). | | @aero-js/content/render | render(doc) for markdown-to-HTML. | | @aero-js/content/types | TypeScript types. |

Usage in apps

Enable content in aero.config.ts (content: true or content: { config: 'content.config.ts' }), then define collections in content.config.ts and import from aero:content in templates.

content.config.ts

import { defineConfig, defineCollection } from '@aero-js/content'
import { z } from 'zod'

const docs = defineCollection({
	name: 'docs',
	directory: 'content/docs',
	include: '**/*.md',
	schema: z.object({ title: z.string(), published: z.boolean().optional() }),
	transform: async doc => ({
		...doc,
		data: { ...doc.data, slug: doc._meta.slug },
	}),
})

export default defineConfig({ collections: [docs] })

In a page (e.g. getStaticPaths + render)

<script is:build>
	import { getCollection, render } from 'aero:content'

	export async function getStaticPaths() {
		const docs = await getCollection('docs')
		return docs.map((doc) => ({ params: { slug: doc._meta.slug }, props: doc }))
	}

	const doc = Aero.props
	const { html } = await render(doc)
</script>
<article each="{ doc in [doc] }">
	<h1>{ doc.data.title }</h1>
	<div>{ html }</div>
</article>

API (from aero:content)

  • getCollection(name, filterFn?) — Returns a promise of documents for the named collection. In production, only documents with data.published === true are returned unless overridden. Optional filterFn(doc) can filter further.
  • render(doc) — Renders a content document’s markdown body to HTML. Returns { html: string }. Use with a document from getCollection or props.

Content document shape

Each document has:

  • id — Collection-relative path without extension.
  • data — Validated frontmatter (from schema).
  • body — Raw markdown (after frontmatter).
  • _meta{ path, slug, filename, extension }.

Vite plugin

aeroContent(options?) resolves the virtual module aero:content (and aero:content/...) with serialized collections, getCollection, and render. It loads content.config.ts at config resolve/build start and watches collection directories for HMR. Options: config (path to config file, default content.config.ts).

File structure

  • src/loader.ts — Load collections, serialize to virtual module source.
  • src/markdown.ts — Parse Markdown and frontmatter (gray-matter, remark).
  • src/render.ts — Lazy markdown-to-HTML (remark).
  • src/types.tsdefineCollection, defineConfig, types.
  • src/vite.ts — Vite plugin.

Tests

Vitest in packages/content: loader, markdown, render, Vite plugin. Run from repo root: pnpm test.