crossbind
GitHub

Die App-Plattform der Agenten-Ära

Baue und veröffentliche JavaScript-Apps für Web, Mobilgeräte und Desktop.

Füge bei Bedarf C++ und Rust hinzu. Mit Erweiterungen bindest du Tools von Drittanbietern an und bringst deine Apps in die App-Stores.

npm create crossbind@beta
Loslegen

Kostenlos und Open Source unter der MIT-Lizenz.

Im Playground ausprobieren
import { initNative, greet } from './native/greet.h';
import { fibonacci } from './native/math.rs';
 
await initNative();
 
console.log(await greet('crossbind'));
console.log(await fibonacci(90));
#pragma once
#include <string>
 
inline std::string greet(std::string name) {
return "Hello, " + name + "!";
}
pub fn fibonacci(n: i32) -> u64 {
let (mut a, mut b) = (0, 1);
for _ in 0..n {
(a, b) = (b, a + b);
}
a
}
# For library projects
npx crossbind build
# For app projects
npx crossbind app upload app-store -p ios
  • BrowserChrome, Firefox, Safari
  • MobilgeräteiOS, Android
    crossbind-Apps · React Native
  • Server & EdgeNode.js, Cloudflare Workers
  • DesktopmacOS, Linux, Windows
    crossbind-Apps · Electron
  • WASIwasmtime 47+

Einrichtung mit einem Agenten

Füge das in Claude Code, Codex, Cursor, Copilot oder einen anderen Coding-Agenten ein:

Lies die Anleitung unter https://crossbind.dev/agent/prompt.md und befolge sie, um crossbind zu diesem Projekt hinzuzufügen.

Der Agent installiert den crossbind-Skill, fügt crossbind zum Projekt hinzu und prüft einen Aufruf aus JavaScript. Anleitung lesen

Vom nativen Quellcode in jede Umgebung.

crossbind holt C++ und Rust, wo immer sie liegen, baut sie für jedes Ziel und liefert jeder Plattform, was sie lädt, verpackt für npm.

Nutze SQLite aus JavaScript.

Führe SQL-Abfragen auf dem Bibliothekskatalog von crossbind aus. SQLite läuft als WebAssembly in deinem Browser.

#pragma once
 
#include <sqlite3.h>
 
#include <stdexcept>
#include <string>
 
class Database {
public:
Database() {
if (sqlite3_open(":memory:", &handle) != SQLITE_OK) throw std::runtime_error("cannot open the database");
}
 
~Database() { sqlite3_close(handle); }
 
std::string version() { return sqlite3_libversion(); }
 
void exec(const std::string& sql) { run(sql); }
 
std::string query(const std::string& sql) {
rows = "[";
run(sql);
rows += "]";
return rows;
}
 
private:
void run(const std::string& sql) {
char* message = nullptr;
if (sqlite3_exec(handle, sql.c_str(), collect, this, &message) == SQLITE_OK) return;
const std::string reason = message ? message : "unknown error";
sqlite3_free(message);
throw std::runtime_error(reason);
}
 
static int collect(void* owner, int count, char** values, char** names) {
Database* self = static_cast<Database*>(owner);
if (self->rows.size() > 1) self->rows += ",";
self->rows += "{";
for (int column = 0; column < count; column += 1) {
if (column) self->rows += ",";
self->rows += quote(names[column]) + ":" + (values[column] ? quote(values[column]) : "null");
}
self->rows += "}";
return 0;
}
 
static std::string quote(const char* text) {
std::string out = "\"";
for (const char* character = text; *character; character += 1) {
if (*character == '"' || *character == '\\') out += '\\';
out += *character;
}
return out + "\"";
}
 
sqlite3* handle = nullptr;
std::string rows;
};
import { initNative, Database } from './native/database.h';
import { catalogAsSql } from './catalog.js';
 
await initNative();
const db = await new Database();
await db.exec(catalogAsSql);
 
const rows = await db.query(`
`);
Der erste Lauf lädt 1,5 MB WebAssembly herunter.Im Playground ausprobieren →

Binde fertige C- und C++-Bibliotheken ein.

Alle 16 Bibliotheken →
Tippe, um alle Seiten und Abschnitte des Leitfadens zu durchsuchen.
↑↓ navigieren↵ öffnenesc schließen