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

@sproutboat/runtime

v0.13.0

Published

The sprout runtime as a unit: the binding and trigger wrapper, handler source validation, both transports (broker and embedded), and the native-fetch prelude. These move as one because `wrap.ts` locates the prelude and transports by file URL beside itself

Readme

@sproutboat/runtime

The sprout runtime as a unit: the binding and trigger wrapper, handler source validation, both transports (broker and embedded), and the native-fetch prelude. These move as one because wrap.ts locates the prelude and transports by file URL beside itself.

bun add @sproutboat/runtime
import { preludePath, transportPath, wrapNativeFetchHandler } from "@sproutboat/runtime";
import { validateHttpSyncSource } from "@sproutboat/runtime";

API

  • wrapNativeFetchHandler(...) turns a user's export default { fetch } into a native-fetch module with bindings, triggers, and env installed. Bindings, EMPTY_BINDINGS, readVarsFromEnv, readBindingsFromEnv, and neutraliseExports travel with it.
  • preludePath / transportPath(transport) locate the prelude and the broker / embedded transports on disk. The prelude is read as text and prepended before compilation, never imported.
  • TRANSPORT_MARKER, BASELINE_COMPATIBILITY_DATE, Transport type.
  • validateHttpSyncSource(source) checks a bundled handler module (SourceValidation), used by project checks on both sides.

The prelude shims the Web API surface handlers expect (URL, Response, crypto random values, binding shims, trigger dispatch) and is identical for both transports, which is what lets one conformance suite hold them honest.

R2 multipart uploads

R2 bindings implement the Cloudflare multipart method shape for objects that are larger than one safe request body:

const upload = env.FILES.createMultipartUpload("archive.tar", {
  httpMetadata: { contentType: "application/x-tar" },
  customMetadata: { source: "backup" },
});

const parts = [];
parts.push(await upload.uploadPart(1, firstChunk));

const resumed = env.FILES.resumeMultipartUpload(upload.key, upload.uploadId);
parts.push(await resumed.uploadPart(2, finalChunk));

const object = await resumed.complete(parts);

Part numbers must be between 1 and 10,000. Parts must be supplied to complete() in ascending order. Every part except the last must have the same size, and the last cannot be larger. Sproutboat permits parts smaller than Cloudflare R2's 5 MiB minimum so the default 1 MiB request-body limit remains useful. Keep each part below the configured request-body limit.

Each part is persisted independently. Standalone completion copies parts into the finished object through a fixed 64 KiB native buffer, so final object size does not determine peak Porffor heap use. A single put() still buffers its whole value; use multipart for larger objects. Call abort() to remove an unfinished upload and its parts.

Completed objects use immutable, etag-addressed blob generations. The metadata row switches to a fully written generation before the previous file is removed. If a metadata update fails, readers continue seeing the previous generation with its matching size and etag.

Unfinished uploads expire after seven days. The broker removes expired parts when another multipart upload starts; a standalone binary removes them when it initializes its embedded store.