7.2.2 • Published 1 year ago

snappy v7.2.2

Weekly downloads
382,014
License
MIT
Repository
github
Last release
1 year ago

snappy

https://github.com/Brooooooklyn/snappy/actions npm.io Install size

!!! 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.

Install this package

yarn add snappy

Support matrix

node12node14node16node18
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
Android arm64
Android armv7
FreeBSD x64

API

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>

Performance

Hardware

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

Result

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
@directus-asolole/api@balena/open-balena-apievent-handler-team-userdimensio@infinitebrahmanuniverse/nolb-snathing-it-server@everything-registry/sub-chunk-2789@astro-utils/forms@arc-directus/apiapollo-server-snappy-cache-wrapperabstract-store@tsjing/snappystream@types/snappy@uc-engg/flash4qau_directus_api@bechara/crux@bechara/nestjs-corebitcore-node-tcrbivcore-nodeblackify@chainsafe/snappy-streamdatapm-clientmemoize-cache-managermemoize-cache-redisdgty-kafka-nodenode-red-contrib-kafka-consumernode-red-contrib-kafka-managernode-red-contrib-kafka-producernemesis-dbnode-document-compressor-snappynode-avro-ionode-avro-io2compressiontool@dekproject/redis@digicube/apiconnect-session-compressmsgpack.iomulticore-nodemongodb-mockmongodb-mock-serverdmdbdpayoamsdoredisa-clientmega-kafka-nodepino-loki-transportmock-gr-api-serverquantum_directus_apipolispay-nodepops-msgpackpops-socket-parser@wbce-d9/api@withcardinal/sstable@convenience/store@coralogix/statsd-backendbrombabrowser-winston-loki@directus/api@directus9/apirws-js-server@gitaflow/api@hoanghuy/kafka-nodeepic-kafka-node@hokify/node-ts-cache-redisio-storagefast-parquet@force-bridge/xredis-stream-accessredis-compressionrequest-http-cache-snappy-compressorraft-leveldbqtp-client@epiclabs/kafka-node@eyzmedia/zohoapisamplersc-winston-loki-betasmc-hub@kenshi.io/unchainedfranz-kafka@luminati-io/snappystream@liqd-js/mongodb-model@polkajs/aes-compressjaysonedjs2pkafkajs-snappy-nativekafkajs-snappy-typescriptkafka-nodekafka-node-als-clonekafka-node-oauthkafka-node-sidvkafka-node2kafka-for-nodekeynote-parser@rws-framework/serverkafka_for_ip_changekafkaqkafka0.8@ioctx/natssnappy-cache-snappy-codecsnappy-clisnappystream
7.2.2

1 year ago

7.2.1

1 year ago

7.2.0

2 years ago

7.1.2

2 years ago

7.1.1

2 years ago

7.1.0

2 years ago

7.0.5

2 years ago

7.0.4

2 years ago

7.0.3

3 years ago

7.0.2

3 years ago

7.0.0

3 years ago

7.0.1

3 years ago

6.3.5

4 years ago

6.3.4

4 years ago

6.3.2

4 years ago

6.3.3

4 years ago

6.2.3

5 years ago

6.2.2

5 years ago

6.2.0

5 years ago

6.1.2

5 years ago

6.1.1

6 years ago

6.1.0

6 years ago

6.0.4

6 years ago

6.0.3

6 years ago

6.0.2

6 years ago

6.0.1

7 years ago

6.0.0

7 years ago

5.0.5

8 years ago

5.0.4

8 years ago

5.0.3

8 years ago

5.0.2

8 years ago

5.0.1

8 years ago

5.0.0

8 years ago

4.1.2

8 years ago

4.1.1

8 years ago

4.1.0

8 years ago

4.0.5

8 years ago

4.0.4

8 years ago

4.0.3

9 years ago

4.0.2

9 years ago

4.0.1

9 years ago

4.0.0

9 years ago

3.2.2

9 years ago

3.2.1

9 years ago

3.2.0

9 years ago

3.1.0

9 years ago

3.0.8

9 years ago

3.0.7

9 years ago

3.0.6

9 years ago

3.0.5

9 years ago

3.0.4

10 years ago

3.0.3

10 years ago

3.0.2

10 years ago

3.0.1

10 years ago

3.0.0

10 years ago

2.1.3

10 years ago

2.1.2

10 years ago

2.1.1

11 years ago

2.1.0

11 years ago

2.0.1

11 years ago

2.0.0

11 years ago

1.3.2

11 years ago

1.3.1

11 years ago

1.3.0

11 years ago

1.2.0

12 years ago

1.1.2

12 years ago

1.1.1

12 years ago

1.1.0

12 years ago

1.0.0

12 years ago