@runebreak/librsync-bundled
v0.1.3
Published
Bundled librsync (WASM) from @dldc-packages/librsync for Node and Electron
Downloads
59
Readme
@runebreak/librsync-bundled
This repo vendors https://github.com/dldc-packages/librsync and bundles it for Node and Electron (main) using esbuild.
Usage
ESM:
import librsync from "@runebreak/librsync-bundled";
const signature = librsync.signature(new Uint8Array([1, 2, 3]));CommonJS:
const librsync = require("@runebreak/librsync-bundled");
const signature = librsync.signature(Buffer.from("hello"));Helpers (Node/Electron):
import {
applyDeltaOverwrite,
makeDiff,
makeSignature,
} from "@runebreak/librsync-bundled";
await makeSignature("basis.bin", "out/basis.sig");
await makeDiff("basis.bin", "new.bin", "out/delta.bin");
await applyDeltaOverwrite("basis.bin", "out/delta.bin");Build
npm install
git submodule update --init --recursive
npm run buildUpdating upstream
This repo tracks upstream librsync via a git submodule at vendor/librsync.
To update it to a newer upstream tag/commit:
cd vendor/librsync
git fetch --tags
# Option A: move to a tag
git checkout v2.0.2
# Option B: move to the latest on a branch
# git checkout main && git pull
cd ../..
git add vendor/librsyncThen rebuild:
npm run buildBuild outputs:
dist/index.js(ESM)dist/index.cjs(CJS)
Licensing
See LICENSE, NOTICE, and THIRD_PARTY_NOTICES.md.
