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

@a83/orbiter-integration

v0.3.7

Published

Astro integration for Orbiter CMS — admin UI, virtual modules, injected routes

Downloads

1,124

Readme

@a83/orbiter-integration

Astro integration for Orbiter CMS — reads content from a .pod file at build time and serves media at runtime.

npm License: MIT Astro


Orbiter stores everything — content, media, schema, users — in a single .pod file (SQLite). This integration makes that content available in your Astro pages via the orbiter:collections virtual module, and serves media files at /orbiter/media/[id].

The admin UI runs separately as @a83/orbiter-admin. Both packages share the same .pod file — the admin writes, the integration reads.


Install

npm install @a83/orbiter-integration @astrojs/node

@astrojs/node@^10 targets Astro 6 — use @astrojs/node@^9 for Astro 5.

Requires Node.js 20+ and Astro 6+.


Setup

// astro.config.mjs
import { defineConfig } from 'astro/config';
import orbiter from '@a83/orbiter-integration';
import node from '@astrojs/node';

export default defineConfig({
  output: 'server',
  adapter: node({ mode: 'standalone' }),
  integrations: [
    orbiter({ pod: './content.pod' }),
  ],
});

For static sites with server-rendered media routes, use output: 'hybrid':

export default defineConfig({
  output: 'hybrid',
  adapter: node({ mode: 'standalone' }),
  integrations: [orbiter({ pod: './content.pod' })],
});

Reading content

---
import { getCollection, getEntry } from 'orbiter:collections';

// All published entries in a collection
const posts = await getCollection('posts');

// Single entry by slug
const post = await getEntry('posts', Astro.params.slug);
---

<ul>
  {posts.map(post => (
    <li><a href={`/blog/${post.slug}`}>{post.data.title}</a></li>
  ))}
</ul>

orbiter:collections is a static snapshot: it reads all published entries from the pod when Astro builds, and inlines them as a JavaScript module. No runtime database access from the browser — the public site is fully static.


orbiter:collections API

getCollection(name: string): Promise<Entry[]>
getEntry(collection: string, slug: string): Promise<Entry | null>

// Multilingual
getLocaleCollection(name: string, locale?: string): Promise<Entry[]>
getLocaleEntry(collection: string, baseSlug: string, locale: string): Promise<Entry | null>

locale:  string    // default locale, e.g. "en"
locales: string[]  // all configured locales, e.g. ["en", "de", "fr"]

Entry shape

{
  id:         string,      // UUID
  slug:       string,      // URL-safe identifier
  status:     'published',
  created_at: string,      // ISO datetime
  updated_at: string,      // ISO datetime
  data: {
    title:    string,
    body:     string,      // richtext → Markdown-rendered HTML
    image:    string,      // media field → UUID
    tags:     string[],    // array field
    author:   Entry,       // relation → resolved Entry object
  }
}

Dynamic routes

---
// src/pages/blog/[slug].astro
import { getCollection, getEntry } from 'orbiter:collections';

export async function getStaticPaths() {
  const posts = await getCollection('posts');
  return posts.map(post => ({ params: { slug: post.slug } }));
}

const post = await getEntry('posts', Astro.params.slug);
---

<article>
  <h1>{post.data.title}</h1>
  <div set:html={post.data.body} />
</article>

Media

<img src={`/orbiter/media/${post.data.image}`} alt={post.data.title} />

/orbiter/media/[id] is an injected server route. It serves the file from whatever backend is configured:

  • blob — reads BLOB from _media.data and streams it
  • local — reads from disk at the stored path
  • github / external link — issues a 302 redirect to the CDN or original URL

No change needed in your templates regardless of backend.


Multilingual

Orbiter uses a slug--locale convention: my-post--de, my-post--fr.

---
import { getLocaleCollection, getLocaleEntry, locales } from 'orbiter:collections';

// All German posts
const posts = await getLocaleCollection('posts', 'de');

// German variant, falls back to base entry if not found
const post = await getLocaleEntry('posts', 'my-post', 'de');
---

Static paths for multilingual sites:

export async function getStaticPaths() {
  const posts = await getCollection('posts');
  const base  = posts.filter(p => !p.slug.includes('--'));
  return base.flatMap(post =>
    locales.map(loc => ({ params: { slug: post.slug, lang: loc } }))
  );
}

Relation fields

Relation fields are resolved at build time — UUID references are replaced with full Entry objects:

{posts.map(post => (
  <div>
    <h2>{post.data.title}</h2>
    <p>by {post.data.author?.data?.name}</p>
    {post.data.categories?.map(cat => <span>{cat.data.name}</span>)}
  </div>
))}

JSON API

A read-only public API is injected at /orbiter/api/[collection]:

curl https://your-site.com/orbiter/api/posts
# or with a token configured in Settings:
curl -H "Authorization: Bearer your-token" https://your-site.com/orbiter/api/posts

Returns all published entries as a JSON array.


Injected routes

The integration adds these routes to your Astro site (nothing added to src/pages):

| Route | Description | |-------|-------------| | /orbiter/media/[id] | Serve media (BLOB, disk, or CDN redirect) | | /orbiter/api/[collection] | Read-only JSON API |

The full admin UI lives in @a83/orbiter-admin — a separate Hono server on port 4322.


Deployment

Orbiter uses better-sqlite3 — a native Node.js module that needs real filesystem access. It does not run on edge runtimes or Cloudflare Workers.

| Environment | Works? | Notes | |-------------|--------|-------| | Node.js VPS / Docker | ✅ | Recommended | | Railway / Render / Fly.io | ✅ | Mount .pod as a persistent volume | | Netlify / Vercel | ⚠️ | Read-only after deploy — run admin separately | | Cloudflare Workers | ❌ | No native Node.js support |


Part of Orbiter

| Package | Description | |---------|-------------| | @a83/orbiter-core | SQLite engine, pod management, auth | | @a83/orbiter-admin | Standalone admin server (Hono, port 4322) | | @a83/orbiter-integration | This package — Astro integration | | @a83/orbiter-cli | orbiter init, add-user, export, pack, unpack |

orbiter.sh · MIT · github.com/aeon022/orbiter