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-fatsoma

v2.1.0

Published

An Astro integration that fetches live event data from the Fatsoma API and keeps event listings automatically up to date.

Readme

astro-fatsoma

A minimal, SSR-first Astro integration for fetching and normalising public event data from the Fatsoma API.

Designed to be clean, stable, and boring by default — no tracking, no client-side fetches, no UI opinions.

Official plugin page:
https://velohost.co.uk/plugins/astro-plugins/astro-fatsoma/


Features

  • ✅ Server-side (SSR) only
  • ✅ Deterministic, stable event shape (v1)
  • ✅ In-memory cache with stale-while-revalidate
  • ✅ Zero client-side JavaScript
  • ✅ No analytics, tracking, or cookies
  • Location support (venue + city)
  • ✅ Designed for Astro sites and static generation

What this plugin does

  • Fetches public events from the Fatsoma API
  • Includes and resolves event locations
  • Normalises the response into a clean v1 interface
  • Caches results in memory (10 minutes by default)
  • Fails safely — never breaks SSR

What this plugin does NOT do

  • ❌ No UI components
  • ❌ No client-side fetching
  • ❌ No auth or private endpoints
  • ❌ No mutation (read-only)
  • ❌ No opinionated formatting

Installation

npm install astro-fatsoma

Compatible with Astro 5.x and 6.x.


Astro configuration

Add the plugin to your astro.config.mjs and provide a Fatsoma page ID.

import { defineConfig } from "astro/config";
import fatsoma from "astro-fatsoma";

export default defineConfig({
  integrations: [
    fatsoma({
      pageId: "YOUR_FATSOMA_PAGE_ID",
    }),
  ],
});

Usage

---
import { getFatsomaEvents } from "astro-fatsoma/fatsoma";

const events = await getFatsomaEvents();
---

<ul>
  {events.map(event => (
    <li>
      <a href={event.url}>{event.name}</a>
      {event.location && (
        <div>{event.location.displayName}</div>
      )}
    </li>
  ))}
</ul>

Public Event Shape (v1)

export interface FatsomaEvent {
  id: string;

  name: string;
  vanity: string;
  seoName: string | null;
  url: string;

  startsAt: string;
  endsAt: string;
  lastEntryTime: string | null;

  currency: string;
  price: {
    min: number | null;
    max: number | null;
  };

  image: string | null;
  descriptionHtml: string | null;

  ageRestriction: string | null;
  attendeesCount: number | null;

  location: {
    name: string;
    city: string | null;
    displayName: string;
  } | null;
}

Caching behaviour

  • In-memory cache (per server instance)
  • TTL: 10 minutes
  • Uses stale-while-revalidate
  • Automatically falls back to stale cache or empty array on failure
import {
  getFatsomaCacheInfo,
  refreshFatsomaCache,
} from "astro-fatsoma/fatsoma";

Encoding & HTML

  • Text is returned exactly as provided by Fatsoma
  • descriptionHtml contains raw HTML
  • Rendering & sanitisation are the responsibility of the consumer

Error handling philosophy

  • Network failures never throw during SSR
  • API errors fail closed
  • Worst case result: []

License

MIT © Velohost
https://velohost.co.uk/