@dldc/rsync
TypeScript icon, indicating that this package has built-in type declarations

4.0.1 • Public • Published

♻️ Rsync

A pure TypeScript implementation of the rsync algorithm

Installation

npm install @dldc/rsync

Usage

import { prepare, diff, apply } 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.

/@dldc/rsync/

    Package Sidebar

    Install

    npm i @dldc/rsync

    Weekly Downloads

    17

    Version

    4.0.1

    License

    MIT

    Unpacked Size

    50.6 kB

    Total Files

    7

    Last publish

    Collaborators

    • etienne-dldc