
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
snappy!!! For snappy@6.x and below, please go to node-snappy.
More background about the 6-7 changes, please read this, Thanks @kesla .
🚀 Help me to become a full-time open-source developer by sponsoring me on Github
Fastest Snappy compression library in Node.js, powered by napi-rs and rust-snappy.
For small size data, snappyjs is faster, and it support browser. But it doesn't have async API, which is important for Node.js program.
yarn add snappy
| node12 | node14 | node16 | node18 | node20 | node22 | |
|---|---|---|---|---|---|---|
| Windows x64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Windows x32 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Windows arm64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| macOS x64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| macOS arm64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Linux x64 musl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Linux arm gnu | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Linux arm64 musl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Linux riscv64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Linux s390x | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Linux powerpc64le | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| OpenHarmony arm64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Android arm64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Android armv7 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Android x86 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Android x64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| FreeBSD x64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| WebAssembly | ✓ | ✓ | ✓ |
export function compressSync(input: Buffer | string | ArrayBuffer | Uint8Array): Buffer
export function compress(input: Buffer | string | ArrayBuffer | Uint8Array): Promise<Buffer>
export function uncompressSync(compressed: Buffer): Buffer
export function uncompress(compressed: Buffer): Promise<Buffer>
OS: Windows 11 x86_64
Host: Micro-Star International Co., Ltd. MS-7C35
Kernel: 10.0.22000
Terminal: Windows Terminal
CPU: AMD Ryzen 9 5950X (32) @ 3.400GHz
Memory: 32688MiB
Running "Compress" suite...
Progress: 100%
snappy:
4 220 ops/s, ±0.66% | fastest
snappy-v6:
2 018 ops/s, ±0.84% | 52.18% slower
gzip:
233 ops/s, ±0.52% | slowest, 94.48% slower
deflate:
235 ops/s, ±0.45% | 94.43% slower
brotli:
7 ops/s, ±0.51% | slowest, 99.85% slower
Finished 4 cases!
Fastest: snappy
Slowest: brotli
Running "Decompress" suite...
Progress: 100%
snappy:
8 528 ops/s, ±1.03% | fastest
snappy-v6:
6 357 ops/s, ±1.76% | 25.46% slower
gzip:
1 406 ops/s, ±1.80% | slowest, 83.51% slower
deflate:
1 435 ops/s, ±1.88% | 83.17% slower
brotli:
1 208 ops/s, ±1.50% | slowest, 86.99% slower
Finished 4 cases!
Fastest: snappy
Slowest: brotli
The 'lz4' package provides bindings for the LZ4 compression algorithm, which is known for its high-speed compression and decompression. Compared to Snappy, LZ4 often offers better compression ratios but may be slightly slower in some scenarios.
The 'zlib' package is a core Node.js module that provides compression and decompression functionalities using the Deflate algorithm. While zlib offers good compression ratios, it is generally slower than Snappy and LZ4.
The 'brotli' package provides bindings for the Brotli compression algorithm, which is known for its high compression ratios and efficiency. Brotli is often used for web content compression but may be slower than Snappy in terms of speed.
FAQs
Fastest Snappy compression library in Node.js
The npm package snappy receives a total of 631,804 weekly downloads. As such, snappy popularity was classified as popular.
We found that snappy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.