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

tgc-availability-widget

v1.0.5

Published

Availability calendar widget for Tresowes Green Cottage — Astro component using a Cloudflare Worker proxy for live iCal data.

Readme

tgc-availability-widget

Availability calendar widget for Tresowes Green Cottage.

Displays live 12-month booking availability for The Cottage and The Barn, sourced from eviivo via a Cloudflare Worker proxy. Supports English, German, and Spanish, and light/dark mode.


Installation

npm install tgc-availability-widget

Usage in an Astro page

---
import TgcAvailability from 'tgc-availability-widget/TgcAvailability.astro';
const locale = Astro.currentLocale; // "en" | "de" | "es"
---

<TgcAvailability property="cottage" lang={locale} />
<TgcAvailability property="barn"    lang={locale} />

Props

| Prop | Type | Default | Description | |-------------|---------------------------|------------------------------------------------------|-------------------------------------| | property | "cottage" \| "barn" | required | Which property to show | | lang | "en" \| "de" \| "es" | "en" | Display language | | months | number | 12 | Total months to load | | proxyBase | string | https://api.tresowesgreencottage.com/api/availability | Override the API base URL |


How it works

Browser → Astro page
           └─ <TgcAvailability> component (inline script, no external request)
                └─ Custom element: <tgc-availability>
                     └─ fetch → api.tresowesgreencottage.com (Cloudflare Worker)
                                    └─ eviivo iCal feed → parsed blocked dates

The component uses an inline script (is:inline) so it works correctly with Astro's View Transitions (<ClientRouter>). The custom element re-initialises on every astro:page-load event, ensuring the calendar renders on first load and after client-side navigation.


Architecture

| Layer | Technology | URL | |-------|------------|-----| | Astro component | npm package | tgc-availability-widget | | iCal proxy | Cloudflare Worker | api.tresowesgreencottage.com | | Widget CDN (legacy) | Cloudflare Pages | widget.tresowesgreencottage.com |


Development

To work on the component locally, use npm link:

# In this package directory:
npm link

# In the Astro project:
npm link tgc-availability-widget

Then import as normal — changes to src/TgcAvailability.astro are reflected immediately.


Publishing to npm

  1. Create an account at npmjs.com
  2. Log in from the terminal: npm login
  3. Publish: npm publish --access public
  4. In the Astro project: npm install tgc-availability-widget

To publish an update:

  1. Bump the version in package.json (e.g. 1.0.1)
  2. Run npm publish --access public
  3. In the Astro project: npm update tgc-availability-widget

License

MIT