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

@figureland/media-tools

v0.0.30

Published

Minimal tools for working with video

Readme

CI NPM

media-tools is a small tool for working with video files on the web. In particular it provides a simple workflow for managing video in Astro projects.

Background

This tool were born out of frustration with the baffling complexity of managing videos on the web. Third-party video platforms like Mux or Cloudinary are great, but they feel like overkill for a lot of smaller projects, and introduce another service, another login and another place where payment details need to be left.

This library is still quite complicated, so there is still a way to go to make it as user friendly as possible, but the core structure is minimal – essentially a much nicer experience of what you can do with ffmpeg and bash scripts.

Getting started

This project depends on bun, ffmpeg and sharp. It's intended for local use, not for CI or servers although that may change with a more mature version in the future.

1. Install the dependency

bun add @figureland/media-tools

2. Run the script

You can now run the media tools CLI to ingest videos and output optimised versions. --src is the source folder for one or more videos. --output is the target folder where you want your optimised videos to live.

"process-video": "media-process-video --src videos --output public"

For each video, it will be optimised and output into two versions (.webm and .mp4) alongside a poster thumbnail, and a .json manifest file. The manifest bundles links to the generated video assets.

3. Access the videos

Your processed videos are now available through an API. You query this using an id which is the original filename of your video, so if your original file is called my-movie.mov then the ID is my-movie.

const manifest = await getVideoManifest('public', 'my-movie')

4. Usage in astro

The library provides an Astro collection Zod schema which transforms the string ID into a VideoManifest if the API can find it. This works similarly to how Astro's built-in image() helper works.

import { video } from '@figureland/media-tools/astro'

const videoAssetsFolder = path.resolve(process.cwd(), 'public')

export const videoSchema = () =>
  z.object({
    type: z.enum(['video']),
    src: video(videoAssetsFolder),
    autoplay: z.boolean().default(true),
    loop: z.boolean().default(true),
    muted: z.boolean().default(true),
    caption: z.string().optional()
  })