Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Install the TypeScript SDK

Prerequisites

Node 20 or newer. A package manager (npm, pnpm, or yarn). A bundler with WASM support if targeting the browser (Vite, Rollup, esbuild, webpack 5+).

Install

npm install @panproto/core
# or
pnpm add @panproto/core
# or
yarn add @panproto/core

Verification

import { Panproto } from '@panproto/core';

const p = await Panproto.init();
console.log(p.listProtocols());

Panproto.init() loads the WASM module and returns the top-level handle. Calling p.listProtocols() enumerates the built-in protocols and confirms the binding is wired up.

Common mistakes

  • Forgetting to await Panproto.init(). The WASM load is asynchronous; using the handle before init resolves throws.
  • Bundler that does not understand .wasm imports. Vite handles this out of the box; older webpack configurations may need a loader.
  • Running under Node 18 or earlier. WebAssembly bigint coercion under those versions is incomplete; some integer operations will throw.

See also