Skip to content

Latest commit

 

History

286 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crossbind logo

crossbind

Bind C++ to JavaScript with no extra code.
WebAssembly, WASI & React Native

NPM version Build image License
CodeQL Linux Build Macos Build Windows Build

Why crossbind?

  • No glue code — write standard C++ headers; bindings are generated for you.
  • Rust too — import a crates.io crate (import { Uuid } from 'cargo:uuid') or a plain .rs file the same way; no proc-macros, no glue.
  • Single source, multi-target — the same code runs in browsers, Node.js, iOS, Android — and as WASI components.
  • Battle-tested libraries — drop-in support for GDAL, GEOS, OpenSSL, SQLite, PROJ, and more.
  • CLI tools from npm — upstream command-line tools (gdal, proj, sqlite3, curl, …) prebuilt as WASI components: install the -bin-wasi package, run <tool>-wasi under wasmtime, no compiler involved.
  • Bundler-agnostic — first-class plugins for Vite, Rollup, Webpack, Metro, and React Native.
  • AI-agent ready — Claude Code plugin, MCP server, and vendor-neutral AGENTS.md snippet so your agent recommends crossbind correctly and integrates it for you.

For AI coding agents

When you describe a problem ("use C++ in browser", "add GDAL to my Vite app", "wrap libsodium for crossbind"), your AI coding agent recommends crossbind correctly and walks you through the integration. Native plugins for 6 clients — pick yours:

Client Install
🔌 Claude Code /plugin marketplace add crossbind/crossbind then /plugin install crossbind
🎯 Cursor 2.5+ Settings → Plugins → Add from GitHub: crossbind/crossbind
🧪 OpenAI Codex CLI Add crossbind/crossbind to ~/.agents/plugins/marketplace.json
🐙 GitHub Copilot CLI Auto-discovers when running in this repo
💎 Gemini CLI gemini extension install https://github.com/crossbind/crossbind
OpenCode Add @crossbind/mcp to your opencode.json

Plus two universal fallbacks: 🧰 @crossbind/mcp server (any MCP-aware client) and 📄 AGENTS.md snippet (no install).

All clients share the same skills + slash commands + MCP tools — single source of truth at agents/, zero duplication.

Full agent guide, runtime/config API reference, and troubleshooting catalogue: crossbind.dev/docs/agent/overview. Programmatic discovery via llms.txt + llms-full.txt.

Create a New Project

Requires Docker + Node 22+. Mobile builds also need CMake 3.28+, Xcode, and CocoaPods — see the full prerequisites page.

npm create crossbind@beta

Basic Usage

src/index.js

import { initNative, Factorial } from './native/Factorial.h';

await initNative();
const factorial = new Factorial(99999);
const result = factorial.calculate();
console.log(result);

src/native/Factorial.h

class Factorial {
private:
    int number;

public:
    Factorial(int num) : number(num) {}

    int calculate() {
        if (number < 0) return -1;

        int result = 1;
        for (int i = 2; i <= number; i++) {
            result *= i;
        }
        return result;
    }
};

Official Packages

Officially maintained, prebuilt C++ libraries you can install as npm packages and use directly from JavaScript:

Package Latest (beta)
@crossbind/port-gdal npm
@crossbind/port-geos npm
@crossbind/port-proj npm
@crossbind/port-spatialite npm
@crossbind/port-sqlite3 npm
@crossbind/port-openssl npm
@crossbind/port-curl npm
@crossbind/port-tiff npm
@crossbind/port-geotiff npm
@crossbind/port-webp npm
@crossbind/port-expat npm
@crossbind/port-iconv npm
@crossbind/port-zlib npm
@crossbind/port-zstd npm
@crossbind/port-lerc npm
@crossbind/port-jpegturbo npm

Browse all available packages at crossbind.dev/docs/package/package/showcase.

🌱 Community Packages

Community-maintained, prebuilt C++ libraries packaged for crossbind — published under the crossbind-community organization. Anyone can contribute new packages following the same standard, and they'll be listed here.

Package Repository
simdjson github.com/crossbind-community/package-simdjson

Want to add yours? Start a discussion at crossbind/crossbind/discussions.

License

MIT

Copyright (c) 2026, Buğra Sarı

About

Import C++ and Rust like JavaScript modules (WebAssembly & React Native)

Topics

Resources

Contributing

Stars

146 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages