This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

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

1.0.2 • Public • Published

!Deprecated!

This package is deprecated in favor of @gcas/rdiff.

Native librsync binding for NodeJS.

Initially based on the node-rdiff package.

Platforms supported

  • Linux (x64): YES
  • Windows (x64): YES
  • MacOS: Not yet, planned (should not be hard to add).

Example

The synchronous api (*Sync functions):

var a = "a.txt"; // Contains "hello".
var b = "b.txt"; // Contains "hello world".

// Compute difference from `a` to `b`.
rdiff.signatureSync(a, `${a}.sig`);
rdiff.deltaSync(`${a}.sig`, b, `${a}.delta`);

// Patch `a` so that it becomes equal to `b`.
rdiff.patchSync(a, `${a}.delta`, `${a}.patched`);

The callback async api:

rdiff.signature(a, `${a}.sig`, function (err) {
    rdiff.delta(`${a}.sig`, b, `${a}.delta`, function (err) {
        rdiff.patch(a, `${a}.delta`, `${a}.patched`, function (error) {
            if (error) {
                return console.error(error);
            }

            // File `a.patched` now equals `b`.
        });
    });
});

The promise async api (*Async functions, recommended):

await rdiff.signatureAsync(a, `${a}.sig`);
await rdiff.deltaAsync(`${a}.sig`, b, `${a}.delta`);
await rdiff.patchAsync(a, `${a}.delta`, `${a}.patched`);
// `a` should equal `a.patched`

Readme

Keywords

Package Sidebar

Install

npm i @gcas/rsync

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

390 kB

Total Files

23

Last publish

Collaborators

  • vpalos