@powersync-community/sync-config-rewriter
v0.1.3
Published
Tools to rewrite Sync Configurations for PowerSync
Keywords
Readme
This exposes the Sync Config rewriter 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-community/sync-config-rewriter";
const wasmBuffer = readFileSync(
fileURLToPath(
import.meta
.resolve("@powersync-community/sync-config-rewriter/compiled.wasm"),
),
);
const module = await instantiate(wasmBuffer);For web apps bundled with vite, use explicit URL imports:
import { instantiate } from "@powersync-community/sync-config-rewriter";
import wasmUrl from "@powersync-community/sync-config-rewriter/compiled.wasm?url";
const module = await instantiate(fetch(wasmUrl));Development
To release a version of this package, update the version entry in
package.json, merge to main and manually trigger the publish_npm
workflow.
