Packages

@cloudflare/sandbox

1.0.3 · 22 Oct 2026Apache-2.02.1M / weekRepositoryHomepagenpmAtom feed

Your version

0.9.3

5 May 2026Where it was published

0.12.14 is the newest release of 0.9.x.

In short

1 new1 faster1 fixed

Release note

Patch Changes

  • Speed up backup and restore for larger archives with faster default compression, multipart R2 uploads, and parallel range downloads that write directly into the restored archive.

  • Introduce new rpc transport to consolidate http and websocket transports.

    The intention is to replace http and websocket transports with a single implementation.

    • No sub-request limitations (currently affects the http transport).

    • No limit on write file size (currently affects both http and websocket transports).

    To enable the transport set SANDBOX_TRANSPORT to rpc in your wrangler config.

    A ReadableStream instance can now be passed to sandbox.writeFile() when using the rpc transport to avoid the 32mb file limit.

    {
      fetch(req, env) {
        const sandbox = getSandbox(env.Sandbox, "my-sandbox");
    
        // A ReadableStream can be passed as the content to writeFile().
        sandbox.writeFile("/workspace/archive.tar.gz", req.body);
    
        return new Response("OK");
      }
    }
  • Surface s3fs mount failures from mountBucket(). Mount errors (bad credentials, wrong bucket name, network failures) now throw S3FSMountError with the underlying s3fs log output, instead of silently returning success and leaving no filesystem attached.

    import { S3FSMountError } from '@cloudflare/sandbox';
    
    try {
      await sandbox.mountBucket('my-bucket', '/mnt/data', {
        endpoint,
        credentials
      });
    } catch (err) {
      if (err instanceof S3FSMountError) {
        // err.message includes the s3fs log tail, e.g. "403 AccessDenied"
      }
    }

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.