Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.
The minizlib npm package is a minimal implementation of zlib bindings for Node.js, providing compression and decompression functionalities in a lightweight and efficient manner. It is designed to be faster and less memory-intensive than the native Node.js zlib module for certain use cases.
Compression
This feature allows you to compress data using the Deflate algorithm. The code sample demonstrates how to compress a simple string.
const { Deflate } = require('minizlib');
const input = Buffer.from('Hello World');
const deflate = new Deflate();
deflate.push(input, true); // true indicates this is the last chunk
if (deflate.err) { throw new Error(deflate.msg); }
const output = deflate.result;
Decompression
This feature enables you to decompress data that was compressed using the Deflate algorithm. The code sample shows how to decompress data to its original form.
const { Inflate } = require('minizlib');
const input = Buffer.from([/* Compressed data here */]);
const inflate = new Inflate();
inflate.push(input, true); // true indicates this is the last chunk
if (inflate.err) { throw new Error(inflate.msg); }
const output = inflate.result;
Pako is a high-speed zlib port to pure JavaScript that works in the browser and Node.js. It offers similar compression and decompression functionalities as minizlib but with a broader scope, including support for gzip, deflate, and inflate algorithms. Pako is often chosen for its performance and compatibility with both server and client-side applications.
node-zlib-backport provides a backport of newer Node.js zlib features to older versions. While it offers similar compression and decompression capabilities, its primary use case is to enable applications running on older Node.js versions to utilize newer zlib functionalities. It's more about compatibility rather than offering a minimalistic approach like minizlib.
A tiny fast zlib stream built on minipass and Node.js's zlib binding.
This module was created to serve the needs of node-tar v2. If your needs are different, then it may not be for you.
require('zlib')
?First, there are no convenience methods to compress or decompress a
buffer. If you want those, use the built-in zlib
module. This is
only streams.
This module compresses and decompresses the data as fast as you feed it in. It is synchronous, and runs on the main process thread. Zlib operations can be high CPU, but they're very fast, and doing it this way means much less bookkeeping and artificial deferral.
Node's built in zlib streams are built on top of stream.Transform
.
They do the maximally safe thing with respect to consistent
asynchrony, buffering, and backpressure.
This module does support backpressure, and will buffer output chunks that are not consumed, but is less of a mediator between the input and output. There is no high or low watermarks, no state objects, and so artificial async deferrals. It will not protect you from Zalgo.
If you write, data will be emitted right away. If you write
everything synchronously in one tick, and you are listening to the
data
event to consume it, then it'll all be emitted right away in
that same tick. If you want data to be emitted in the next tick, then
write it in the next tick.
It is thus the responsibility of the reader and writer to manage their own consumption and process execution flow.
The goal is to compress and decompress as fast as possible, even for files that are too large to store all in one buffer.
The API is very similar to the built-in zlib module. There are
classes that you instantiate with new
and they are streams that can
be piped together.
FAQs
A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.
The npm package minizlib receives a total of 14,872,189 weekly downloads. As such, minizlib popularity was classified as popular.
We found that minizlib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.