Skip to main content

@dldc/rsync@4.0.1
Built and signed on GitHub Actions

A pure TypeScript implementation of the rsync algorithm

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
76%
Published
10 months ago (4.0.1)

♻️ Rsync

A pure TypeScript implementation of the rsync algorithm

Installation

npm install @dldc/rsync

Usage

import { apply, diff, prepare } from "@dldc/rsync";

const checksum = prepare(destFile); // you can specify block size as second argument (default: 1024)
// send checksum to source
const patches = diff(sourceFile, checksum);
// send patches to dest
const syncedFile = apply(destFile, patches);

Performance

This package was not designed to be fast. Since it's implemented fully in TypeScript, it's not as fast as the C implementation of rsync. I tried to use the best practices to make it less slow but I did not benchmark it 🤷.

Dependencies 🪶

This package has a single dependency @dldc/erreur to define custom errors.

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@dldc/rsync

Import symbol

import * as rsync from "@dldc/rsync";

---- OR ----

Import directly with a jsr specifier

import * as rsync from "jsr:@dldc/rsync";

Add Package

npx jsr add @dldc/rsync

Import symbol

import * as rsync from "@dldc/rsync";

Add Package

yarn dlx jsr add @dldc/rsync

Import symbol

import * as rsync from "@dldc/rsync";

Add Package

pnpm dlx jsr add @dldc/rsync

Import symbol

import * as rsync from "@dldc/rsync";

Add Package

bunx jsr add @dldc/rsync

Import symbol

import * as rsync from "@dldc/rsync";