
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
easy and reusable way to compress and decompress text data without headers (e.g. for storage in redis)
var opts = {
disabled: true
};
var opts = {
// ...
direct: true
// ...
};
var opts = {
// ...
pool: {
max: 100
// see for more: https://github.com/coopernurse/node-pool#documentation
}
// ...
};
var zip = new comprezzor(true, opts);
var unzip = new comprezzor(false, opts);
// use from multiple threads
zip.pool.destroyAllNow();
unzip.pool.destroyAllNow();
var laeh2 = require('laeh2');
var _x = laeh2._x;
var _e = laeh2._e;
var comprezzor = require('comprezzor');
function cb(err, res) {
console.log(err ? err.stack : res);
}
var opts = {
windowBits: 14,
memLevel: 7,
level: 'Z_BEST_COMPRESSION',
strategy: 'Z_DEFAULT_STRATEGY'
};
var zip = new comprezzor(true, opts);
var unzip = new comprezzor(false, opts);
console.log('zip: ' + zip.info());
console.log('unzip: ' + unzip.info());
var input = 'my test input. my test input. my test input. my test input. my test input. my test input.';
console.log('input: %s', input);
console.log('input length: %d', input.length);
zip.make(input, _x(cb, true, function(err, res) {
// res is a buffer now
//console.log(res);
console.log('zipped length: %d', res.length);
unzip.make(res, _x(cb, true, function(err, res) {
// res is a string now
// console.log(res);
console.log('unzipped length: %d', res.length);
zip.make(res, _x(cb, true, function(err, res) {
// res is a buffer now
//console.log(res);
unzip.make(res, _x(cb, true, function(err, res) {
// res is a string now
cb(null, res === input ? 'match' : 'no match');
}));
}));
}));
}));
FAQs
easy and reusable way to compress and decompress text data without headers (e.g. for storage in redis)
We found that comprezzor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.