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

zstd

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zstd

ZSTD lossless compression algorithm bindings for Node.js

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

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

Keywords

zstd

FAQs

Package last updated on 09 Feb 2015

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