zstd

1.0.4 • Public • Published

node-zstd

ZSTD lossless compression algorithm bindings for Node.js.

Installation

$ npm install zstd

In case of npm install error:

gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp

Try to sudo apt-get install nodejs-legacy or sudo ln -s "$(which nodejs)" /usr/bin/node.

Usage

var zstd = require('zstd');
 
var data = new Buffer(1000);
data.fill('A');
 
var compressed = zstd.compress(data);
var decompressed = zstd.decompress(compressed);
 
console.log('Compressed:', compressed.length);
console.log('Decompressed:', decompressed.length);
 
//Compressed: 25
//Decompressed: 1000

Tests

$ npm test

License

MIT

Package Sidebar

Install

npm i zstd

Weekly Downloads

26

Version

1.0.4

License

MIT

Last publish

Collaborators

  • x25