Runpak is a local developer tool for interactively testing npm and pnpm packages in real Browser and Node.js runtimes.
Point Runpak at a local package root, write a small TypeScript or JavaScript entry file, then run it without creating a throwaway app.
pnpm installpnpm startRunpak starts at:
http://localhost:7777
- Enter a package root path. The directory must contain
package.json. - Choose
BrowserorNode.js. - Write code in the editor.
- Import the package by its real package name and exported subpaths.
- Use
console.log,console.warn, orconsole.errorto inspect output. - Use
returnto show the primary result. - Click
Run.
Example:
import { createClient } from "example-package/client";
const client = createClient({ environment: "staging" });
const result = await client.items.list();
return result;Runpak does not install or build your package. Build the package yourself first if your source needs compilation.