userland.run70Try the demo
Catalog app · RISC-V VM

Run sd in the browser

Find and replace text with familiar regex syntax — a simpler sed for substitutions.

Try it live

Nothing is downloaded until you press Run.

catalog app

Replace with a capture group

Installs sd 1.0.0 from the signed catalog (every chunk is verified before it is written), then runs the commands below in the VM's shell.

bash
sd --version
echo 'version = 1.2.0' | sd '(\d+)\.(\d+)\.(\d+)' 'v$1.$2.$3'
loading…
Expected output
$ sd --version
sd 1.0.0
$ echo 'version = 1.2.0' | sd '(\d+)\.(\d+)\.(\d+)' 'v$1.$2.$3'
version = v1.2.0

What it is

sd replaces text using the regex syntax of JavaScript and Python, with literal mode (-F) and capture groups ($1), and edits files in place when given paths. It avoids sed's escaping rules for the common substitution case. In the browser it rewrites files in the VM as part of client-side tooling.

Package facts

version
1.0.0
runs on
RISC-V VM (elf-app, riscv64gc-linux-musl)
download
956 kB compressed · 1 file
command
sd
requires
nothing else — a static binary
license
MIT (upstream)
upstream
github.com/chmln/sd
categories
Text
catalog
generation 12, Ed25519-signed

Install and run it from your page

With the SDK, installApp resolves sd in the signed index, fetches its content-addressed chunks from the CDN, verifies each one and writes the files into the VM. Details in Installing catalog apps.

javascript
import { createNano } from "@userland-run/nano-sdk";

const nano = await createNano({ image: { wasm: "/nano/console.wasm" }, ramMB: 512 });
await nano.installApp("sd"); // signature-verified, cached in OPFS

const r = await nano.shExec("sd --version");
console.log(r.stdout);

Typical usage of the upstream command-line tool:

bash
sd 'from "(\w+)"' 'from "@lib/$1"' src/*.ts

← All 32 catalog apps