fossil-delta
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/fossil-delta package

1.0.2 • Public • Published

Fossil SCM delta compression algorithm

The cool thing about it is that plain text inputs generate plain text deltas (binary inputs, of course, may generate binary deltas).

Build Status

Installation

$ npm install fossil-delta

or just download fossil-delta.min.js.

Direct usage:

<script src="fossil-delta.min.js"></script>

CommonJS:

var fossilDelta = require('fossil-delta')

Usage

fossilDelta.create(origin, target)

Returns a delta (as Array of bytes) from origin to target (any array-like object containing bytes, e.g. Uint8Array, Buffer or plain Array).

fossilDelta.apply(origin, delta[, opts])

Returns target (as Array of bytes) by applying delta to origin.

Throws an error if it fails to apply the delta (e.g. if it was corrupted).

Optional argument opts can be

{
    verifyChecksum: false
}

to disable checksum verification (which is enabled by default.)

fossilDelta.outputSize(delta)

Returns a size of target for this delta.

Throws an error if it can't read the size from delta.

Package Sidebar

Install

DownloadsWeekly Downloads

127

Version

1.0.2

License

BSD

Unpacked Size

22.7 kB

Total Files

5

Last publish

Collaborators

  • dchest