sonic-bun ๐
December 26, 2025 ยท View on GitHub
A minimalist, high-performance Sonic TCP client for the Bun runtime.
Installation
bun add sonic-bun
Quick Start
import { SonicClient } from "sonic-bun";
const sonic = new SonicClient({
host: "localhost",
port: 1491,
auth: "SecretPassword",
});
// Indexing text
await sonic.push("collection", "bucket", "object_id", "The quick brown fox");
// Searching
const results = await sonic.query("collection", "bucket", "brown fox");
console.log(results); // ["object_id"]
await sonic.quit();
API
push(collection, bucket, object, text, lang?)query(collection, bucket, terms, options?)suggest(collection, bucket, word, limit?)flush(collection, bucket?, object?)quit()