bsdiff-neon
v0.2.0
Published
A Neon node extension that wraps the Rust bsdiff crate
Downloads
4
Readme
bsdiff-neon
bsdiff-neon: A Neon node extension that wraps the Rust bsdiff crate
This project was bootstrapped by create-neon.
Example
const bsdiff = require("bsdiff-neon");
const crypto = require("crypto"); // for random values
const oldData = crypto.randomBytes(1024).buffer;
const newData = crypto.randomBytes(1024).buffer;
const diff = bsdiff.diff(oldData, newData);
const newRecovered = bsdiff.patch(oldData, diff, 1024);
Installing bsdiff-neon
Installing bsdiff-neon requires a supported version of Node and Rust.
You can install the project with npm. In the project directory, run:
$ npm install
This fully installs the project, including installing any dependencies and running the build.
Building bsdiff-neon
If you have already installed the project and only want to run the build, run:
$ npm run build
This command uses the cargo-cp-artifact utility to run the Rust build and copy the built library into ./index.node
.
Learn More
To learn more about Neon, see the Neon documentation.
To learn more about Rust, see the Rust documentation.
To learn more about Node, see the Node documentation.