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

astro-build-info

v1.0.1

Published

Static build metadata output for Astro sites

Readme

astro-build-info

Static-first build metadata for Astro

astro-build-info is a minimal Astro integration that generates a machine-readable /build-info.json file at build time.

It is designed to be honest, deterministic, and safe for fully static sites.

This plugin answers one simple question:

What exactly was built, and when?

It does not pretend to be a health check or runtime status endpoint.


Why this exists

In real-world deployments, teams often need to know:

  • Is this the latest build?
  • Which site URL does this build belong to?
  • Was this built as static, hybrid, or server output?
  • When was this artefact generated?

Today, answers usually involve:

  • guessing from HTML
  • checking CI logs
  • leaking environment variables
  • adding ad-hoc debug pages

astro-build-info solves this cleanly by exposing build metadata only.


What it does (v1)

On astro build, the plugin writes a file:

/build-info.json

With contents like:

{
  "framework": "astro",
  "output": "static",
  "site": "https://example.com",
  "builtAt": "2026-01-08T18:46:10.939Z"
}

This file is:

  • Static
  • Cache-safe
  • Deterministic
  • Machine-readable
  • Safe to expose publicly

What it does NOT do

This plugin deliberately does not:

  • Act as a runtime health check
  • Execute on every request
  • Read environment variables
  • Expose system information
  • Leak CI or machine details
  • Track users
  • Require cookies
  • Require Cloudflare Workers or edge functions

If you need runtime liveness or request-aware behaviour, that is a v2 concern and requires hybrid or server output.


Installation

npm install astro-build-info

Or during development:

npm link astro-build-info

Usage

Add the integration to your astro.config.mjs:

import { defineConfig } from "astro/config";
import astroBuildInfo from "astro-build-info";

export default defineConfig({
  site: "https://example.com",
  integrations: [
    astroBuildInfo()
  ]
});

That’s it.

On build, /build-info.json will be written to your output directory.


Static-first by design

In static mode:

  • The file is generated at build time
  • The output never changes until the next build
  • The file can be cached indefinitely

In future versions (v2):

  • Hybrid and server output may enable runtime endpoints
  • Additional metadata may be optionally exposed

v1 makes no false claims about runtime state.


CDN & Cloudflare compatibility

This plugin works perfectly behind:

  • Cloudflare proxy
  • Netlify
  • Vercel
  • S3 / static hosting
  • Any CDN

Because the output is static:

  • It is safe to cache
  • It will not fragment caches
  • It introduces zero runtime overhead

Security & hardening

This plugin is intentionally low-risk:

  • No user input
  • No request handling
  • No filesystem reads
  • No dynamic paths
  • No secrets

If the file cannot be written, the build continues safely.


Roadmap

Planned for v2 (not in v1):

  • Optional runtime endpoint (hybrid/server)
  • Optional text format (/build-info.txt)
  • Optional CI metadata (explicitly allow-listed)

v1 is intentionally minimal.


License

MIT


Philosophy

Static sites should not lie about being dynamic.

astro-build-info prefers correctness and transparency over convenience.


Author

Built and maintained by Velohost
https://velohost.co.uk/