@powersync/sync-config-tools
v0.1.1
Published
Editing tools for Sync Streams used by the PowerSync Dashboard and CLI.
Downloads
186
Keywords
Readme
This exposes the Sync Config editing tools as a package usable from JavaScript.
Instantiation
This package requires you to load a compiled WebAssembly file, which depends on your target platform.
On Node.JS, resolve and load the WASM file:
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { instantiate } from "@powersync/sync-config-tools";
const wasmBuffer = readFileSync(
fileURLToPath(
import.meta
.resolve("@powersync/sync-config-tools/compiled.wasm"),
),
);
const module = await instantiate(wasmBuffer);For web apps bundled with vite, use explicit URL imports:
import { instantiate } from "@powersync/sync-config-tools";
import wasmUrl from "@powersync/sync-config-tools/compiled.wasm?url";
const module = await instantiate(fetch(wasmUrl));Development
To release a new version of this package:
- Update the
versionentry inpackage.json. - Wait for that to get approved and merge to
main. - Trigger the
publish_npmworkflow on themainbranch.
