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

@sandbox-workers/perl

v0.2.0

Published

Deployable Perl WebAssembly sandbox for Cloudflare Workers Service Bindings

Downloads

204

Readme

@sandbox-workers/perl

Deploy to Cloudflare

Use the source template as an alternative to the npm package. It creates a private Worker; configure your caller’s Service Binding after deployment. The source repository must be public for the button to work.

A Cloudflare Workers Service Binding runtime containing Perl 5.42.2 compiled to Wasm by goccy/perl-wasm v0.2.1.

Quick start

pnpm dlx @sandbox-workers/cli init perl my-perl
cd my-perl
pnpm install
pnpm run dry-run
pnpm run deploy

Before publication, install the local tarball produced by the repository's pnpm run pack.

The initializer refuses to overwrite existing files. Choose a Worker name in wrangler.perl.jsonc that fits your account. Public URLs are disabled. Use a Paid plan for execution: interpreter initialization can exceed the Free plan's CPU allowance.

Existing Worker project

Use this entrypoint in a dedicated Worker:

export { default, Interpreter } from "@sandbox-workers/perl";

Add a Data module rule for the bundled standard library. The initializer includes this configuration automatically:

{
  "rules": [{ "type": "Data", "globs": ["**/*.bin"], "fallthrough": true }],
}

Disable workers_dev and preview_urls, deploy the runtime, and add a Service Binding to the calling application's configuration:

{ "services": [{ "binding": "PERL", "service": "sandbox-perl" }] }

The service name must match the deployed Worker. Install @sandbox-workers/core in the calling application for stateless, one-shot execution:

import { runCode } from "@sandbox-workers/core";
const output = await runCode(env.PERL, "my $x = $ENV{X};\n$x ** 2", {
  envVars: { X: "12" },
});
// output.results[0].text === "144"

This package's INTERPRETER Durable Object binding (Interpreter, already in this Worker's wrangler.perl.jsonc) is what backs durable, stateful code contexts (globals persist across calls). To use them, your own Worker (not this one) hosts a Sandbox Durable Object from @sandbox-workers/core and opens contexts bound to this Worker by name, instead of the stateless runCode above:

// your wrangler.jsonc
{
  "durable_objects": { "bindings": [{ "name": "Sandbox", "class_name": "Sandbox" }] },
  "migrations": [{ "tag": "v1", "new_sqlite_classes": ["Sandbox"] }],
  "services": [{ "binding": "PERL", "service": "sandbox-perl" }]
}
// your Worker's entry
export { Sandbox } from "@sandbox-workers/core";
import { getSandbox } from "@sandbox-workers/core";

const sandbox = getSandbox(env.Sandbox, "user-42");
const ctx = await sandbox.interpreter.createCodeContext({ binding: "PERL" });
await sandbox.interpreter.runCode("our $counter = 1;", { context: ctx });
await sandbox.interpreter.runCode("$counter + 1;", { context: ctx }); // 2

See the sandboxes and code contexts guide for the full client API, the files API, and per-language REPL semantics.

Execution contract

POST /execute accepts { code, envVars }. This runtime Worker always executes Perl; the runtime is chosen by the Service Binding, not by the request. Code is a script: the value of the last top-level expression is the result. Env vars are available as %ENV, e.g. $ENV{NAME}. Standard output is captured in the response's logs.stdout. HASH/ARRAY ref results are returned as { json }; everything else is returned as { text: "$v" }.

Each execution creates a fresh Wasm instance; no context persists between calls. Host environment variables, networking, and files are unavailable — only the key/value pairs passed in envVars are visible. Limits include 64 KiB of code, a 96 KiB request, 32 KiB of combined stdout/stderr, 64 MiB of Wasm linear memory, a 64 KiB serialized result, and a fuel budget. Installing external packages or arbitrary native extensions is unsupported.

See THIRD_PARTY_NOTICES.md for licenses and upstream sources.