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

@mistriwork/cloudflare

v1.4.2

Published

A mistri App on Cloudflare Containers: the Container class and Worker handlers `mistri deploy init cloudflare` writes against, so a fix to the glue is a package upgrade.

Readme

@mistriwork/cloudflare

A mistri App on Cloudflare Containers: the container class and the Worker handlers that mistri deploy init cloudflare writes a Worker against, so a fix to the glue is a package upgrade rather than a diff in every project.

import { MistriContainer, mistriWorker } from '@mistriwork/cloudflare';

export class App extends MistriContainer {
  static override options = { vars: ['MISTRI_PUBLIC_URL'], secrets: ['BETTER_AUTH_SECRET'] };
}
export default mistriWorker({ binding: 'APP', instance: 'app-1', location: 'enam' });

MistriContainer is always on, waits out mistri's startup checks before it answers 500, hands the Worker's named vars and secrets to the container, and logs its start and exit. It also upgrades itself: wrangler deploy rolls nothing out under the durable_object scheduling policy and a running container keeps its startup image and env, so the Durable Object records what it started the container with (image, MISTRI_DEPLOY_ID, instance type) and, on a request or the Worker's tick, replaces a healthy container that differs from what its own Worker version wants (never one still starting, at most once a minute). The platform moves a running Durable Object onto a new Worker version only after about five minutes, so mistriWorker stamps its version on the status probe and the tick, and an object behind a newer Worker resets itself (at most once per 30 seconds) and starts again on it. GET /__mistri/status with MISTRI_RESTART_TOKEN in x-mistri-restart reports the Worker version (version_metadata binding CF_VERSION_METADATA), what is desired and what the container started with, which mistri deploy polls; a POST with the token stops the container, the manual fallback. Its options are port, instanceType and image (pinned at each start, for an account whose container applications are created by the Durable Object), startupTimeoutMs, vars, secrets, restartTokenEnv, sleepAfter and alwaysOn.

mistriWorker returns fetch (every request to the one named instance, as it is, so WebSockets and streams pass) and scheduled (a once-a-minute /readyz that starts the instance if a host restart or a rollout stopped it).

forwardEmail(message, env, { binding, instance, secretEnv, parse }) signs an inbound message (HMAC-SHA-256 over <timestamp>.<body>) and posts it to the App's /api/mail/inbound through the Durable Object. Hand it the parser: parse: (raw) => PostalMime.parse(raw); this package carries none. An attachment's bytes are sent as base64 whichever way the parser hands them (an ArrayBuffer, a typed array, or base64 text already). A 2xx or a replayed delivery (409) is done; a 404, 413, 400 or 422 rejects the message with a reason; anything else (401, 403, 429, 5xx) throws, so a signing or configuration fault is retried and logged rather than finishing as if the mail were forwarded.

@cloudflare/containers is a peer dependency. mistri itself depends on nothing here. Source.