ts-bindings

Create WebAssembly bindings for TypeScript and JavaScript using Rust and wasm-bindgen.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/agentglass/claude-trace --skill ts-bindings
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts-bindings
Source: https://github.com/agentglass/claude-trace/tree/main/.claude-plugin/skills/ts-bindings
Command: npx skills add https://github.com/agentglass/claude-trace --skill ts-bindings

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides expert context and tooling for creating efficient and ergonomic WebAssembly (WASM) bindings for TypeScript and JavaScript applications using wasm-bindgen.

Core Features & Use Cases

  • WASM Module Generation: Guides the process of compiling Rust code to WASM with wasm-pack.
  • TypeScript Integration: Details how to expose Rust structs and functions to JavaScript/TypeScript, including automatic type generation.
  • Ergonomic Layer: Shows how to build a user-friendly TypeScript API on top of raw WASM bindings.
  • Use Case: Integrating a high-performance Rust library (e.g., for image processing or complex calculations) into a web application or Node.js backend.

Quick Start

Use the ts-bindings skill to generate WASM bindings for a Rust project targeting Node.js.

Frequently Asked Questions about ts-bindings

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose Rust functions to TypeScript using wasm-bindgen?

You can expose Rust functions to TypeScript using wasm-bindgen by applying its attribute macros, compiling the code to WebAssembly, and generating automatic TypeScript declaration files alongside the JavaScript API layer.

What's the best way to generate WebAssembly bindings for a Node.js backend?

The best way to generate WebAssembly bindings for a Node.js backend is configuring your build to target Node.js, using wasm-pack to compile Rust code, and exposing the resulting WASM module functions to your JavaScript environment.

Can I use wasm-pack to build an ergonomic JavaScript API layer from Rust?

Yes, you can use wasm-pack to compile Rust to WASM and then build an ergonomic JavaScript API layer on top of the raw WebAssembly bindings to improve usability for application developers.

Does wasm-bindgen support automatic TypeScript declaration generation for web browsers?

wasm-bindgen supports automatic TypeScript declaration generation for web browsers by configuring your build target appropriately, ensuring Rust types and functions are exposed with correct type definitions.

How do I configure build targets for WebAssembly modules in a web application?

You configure build targets for WebAssembly modules in a web application by adjusting wasm-pack build configurations to match specific targets like web browsers, Node.js, or bundlers, ensuring correct WASM output.

When do I need to integrate high-performance Rust libraries into a TypeScript application?

You need to integrate high-performance Rust libraries into a TypeScript application when executing compute-heavy tasks like image processing or complex calculations, utilizing WebAssembly bindings to bridge the environments.