Skip to content
 
 

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snappy-wasm

JavaScript compression/decompression with snappy for browsers and Node.js, powered by WebAssembly.

Built with 🦀🕸 by The Rust and WebAssembly Working Group

Installation

npm i snappy-wasm

🚴 Usage

Browser / ES Modules

import init from 'snappy-wasm'

// ...
const snappy = await init()

Note that additional configuration may be required to support top-level await in your environment.

Node.js

const snappy = require('snappy-wasm')

For use exclusively in Node.js, the snappy package may provide better performance.

Compress data

const data: Uint8Array = ...;
const compressed: Uint8Array = snappy.compress(data)

Decompress data

const decompressed: Uint8Array = snappy.decompress(compressed)

🛠️ Build with wasm-pack build (via npm script)

npm run build

🔬 Test in Headless Browsers with wasm-pack test

wasm-pack test --headless --firefox

🎁 Publish to NPM

npm run build
npm publish

🔋 Batteries Included

  • wasm-bindgen for communicating between WebAssembly and JavaScript.

👾 Development

Install the following

About

Snappy compression/decompression for browsers and Node.js, powered by WebAssembly

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages