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

@casoon/astro-castwright

v0.6.0

Published

Astro integration for castwright — <TerminalDemo /> and automatic Vite plugin registration.

Readme

@casoon/astro-castwright

The Astro integration for castwright: automatic Vite plugin registration and a <TerminalDemo /> component.

Deliberately thin. The Vite plugin in @casoon/castwright does the compiling and <castwright-demo> from @casoon/castwright-player does the playing; both work in Astro without this package. It exists so you do not have to wire them yourself.

Install

pnpm add @casoon/astro-castwright
// astro.config.mjs
import castwright from '@casoon/astro-castwright';

export default defineConfig({ integrations: [castwright()] });

Use

---
import TerminalDemo from '@casoon/astro-castwright/TerminalDemo.astro';
import demo from '../demos/install.terminal.yaml';
---

<TerminalDemo demo={demo} autoplay loop />

The component inlines the compiled cast as JSON (no fetch, no parser in the bundle), emits the final terminal text as the light-DOM accessibility fallback, and reserves the terminal's height so hydration does not shift the page.

The reserved height is the row count (the cast's, or the rows prop) plus the screen padding, the title bar (unless chrome="none") and the transport row (unless controls is hover or none), using chrome heights measured from the player. Row height depends on the visitor's monospace font, and a terminal wider than its container is scaled down by the player, so the reservation is exact only at the authored size; it is min-height only and is dropped as soon as the player has measured for real.

Pass src="/demo.cast" instead of demo to fetch a pre-built cast at runtime. There is no compiled cast to take the accessibility fallback from, so give it as slot content:

<TerminalDemo src="/demo.cast" rows={20}>
  <pre>$ npm install castwright
added 42 packages</pre>
</TerminalDemo>

Without a slot the build warns, and assistive technology gets an empty box until the player loads. Without demo, the height is only reserved when rows is set.

demo and src aside, the props mirror the element's attributes: autoplay, loop, loopDelay, poster, cols, rows, label, title, chrome, controls, class.

Licence

MIT