New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

bsdiff-nodejs

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bsdiff-nodejs

An binary diff and patch library based on bsdiff algorithm for NodeJS (Windows, Mac, Linux).

Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
241
346.3%
Maintainers
1
Weekly downloads
 
Created
Source

bsdiff-nodejs

An binary diff and patch library based on bsdiff algorithm for NodeJS (Windows, Mac, Linux)

INSTALLATION

Install as a dependency for your project:

npm install --save bsdiff-nodejs

USAGE

const bsdiff = require('bsdiff-nodejs');
bsdiff.diff(oldFile, newFile, patchFile, function(result, err) {}); // Async
bsdiff.patch(oldfile, newfile, patchfile, function(result, err) {}); // Async

For example:

const bsdiff = require('bsdiff-nodejs');
const path = require('path');

const oldFile = path.join(__dirname, 'resources/react-0.3-stable.zip');
const newFile = path.join(__dirname, 'resources/react-0.4-stable.zip');
const patchFile = path.join(__dirname, 'resources/react.patch');
const generatedFile = path.join(__dirname, 'resources/react-generated.zip');

bsdiff.diff(oldFile, newFile, patchFile, function(result, err) {
    if(err) return console.log('Error:', err);
    console.log(result + "%");

    if(result === 100) {
        console.log("Patch");
        bsdiff.patch(oldFile, generatedFile, patchFile, function(result, err) {
            if(err) return console.log('Error:', err)
            console.log(result + "%");
        });
    }
});

License

Copyright 2003-2005 Colin Percival

Keywords

bsdiff

FAQs

Package last updated on 27 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts