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

@dwk/calendar

v0.1.0-beta.1

Published

Canonical JSCalendar (RFC 8984) event model with an RFC 5545 iCalendar (.ics) serializer and a stateless text/calendar feed handler for webcal:// subscription.

Downloads

62

Readme

@dwk/calendar

Canonical event model + calendar serializers: a JSCalendar (RFC 8984)-shaped CalendarEvent, an RFC 5545 iCalendar (.ics) emitter, a JSCalendar JSON serializer, and an optional stateless text/calendar feed handler for webcal:// subscription.

Part of @dwk/workers — composable Cloudflare Workers packages implementing open web standards on your own domain. It is a cross-standard reusable lib: pure, zero-dependency, Workers-runtime-free, and deliberately free of any one standard's assumptions.

Install

npm install @dwk/calendar

Why it exists

One event record, several serializations. The calendar/events epic wants an IndieWeb h-event, an iCalendar VEVENT, an ActivityStreams Event, and a pod RDF resource to be views of the same record. @dwk/calendar holds that shared CalendarEvent model and the two format-pure serializers; the vocabulary-specific adapters (e.g. h-event → CalendarEvent) live in the endpoint packages that own each vocabulary and depend on this lib.

Usage

Serialize an event to iCalendar

import { toICalendar, type CalendarEvent } from "@dwk/calendar";

const event: CalendarEvent = {
  uid: "[email protected]",
  title: "Park Cleanup",
  start: "2026-07-01T18:00:00-07:00",
  end: "2026-07-01T20:00:00-07:00",
  locations: [{ name: "Civic Center" }],
  keywords: ["volunteering"],
};

const ics = toICalendar(event); // a complete VCALENDAR string

Serve a subscribable feed

import { createCalendarFeed } from "@dwk/calendar";

// Stateless and binding-free: you inject the events resolver.
const handler = createCalendarFeed({
  calName: "Community Events",
  prodId: "-//Example//Events//EN",
  events: async () => loadUpcomingEvents(), // your store
});

// handler(request) → Response (text/calendar) — mount it in your Worker.

JSCalendar JSON

import { toJSCalendar } from "@dwk/calendar";

const json = toJSCalendar(event); // an RFC 8984 Event object

API

| Export | Purpose | | --- | --- | | CalendarEvent (type) | The canonical, JSCalendar-shaped event model. | | toICalendar(event, opts?) | One event → a VCALENDAR string. | | toICalendarFeed(events, opts?) | Many events → one subscribable feed. | | toJSCalendar(event) | Event → a JSCalendar (RFC 8984) JSON object. | | createCalendarFeed(config) | Stateless text/calendar feed handler. | | toICalDate, toInstant, formatUtc | Date-time helpers. |

Notes

  • Output is RFC 5545-correct on CRLF endings, 75-octet line folding, and TEXT escaping. No METHOD is emitted, keeping feeds subscription-friendly.
  • Dates are RFC 3339 strings; offset/Z times normalise to UTC instants, date-only values are all-day, and floating times can be qualified with an IANA timeZone.
  • MVP is export-only; .ics import is a planned follow-up.

License

ISC