1.2.1 • Published 5 months ago

huffy v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Huffy

A tiny compression library based on Huffman coding.

Install

npm install huffy

Usage

import {compress, decompress} from 'huffy';

// Let's make some data to compress

const str = 'some string to compress, it works better with longer things'.repeat ( 10 );
const buffer = new TextEncoder ().encode ( str );

// Let's compress and decompress it

const compressed = compress ( buffer );
const decompressed = decompress ( compressed );

// Let's print the compression ratio

console.log ( 'Compression ratio:', compressed.length / buffer.length );

License

MIT © Fabio Spampinato

1.2.1

5 months ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago