Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amaui-org/amaui-lz77
LZ77
https://github.com/amaui-org/amaui-lz77
algorithm amaui backend binary-compression browser byte-compression compress compression frontend javascript js lz77 lz77-compress lz77-compression-algorithm lz77-encoding node nodejs text-compression typescript web
Last synced: 1 day ago
JSON representation
LZ77
- Host: GitHub
- URL: https://github.com/amaui-org/amaui-lz77
- Owner: amaui-org
- License: mit
- Created: 2022-02-14T22:51:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-29T22:27:46.000Z (7 months ago)
- Last Synced: 2024-08-08T15:39:05.713Z (3 months ago)
- Topics: algorithm, amaui, backend, binary-compression, browser, byte-compression, compress, compression, frontend, javascript, js, lz77, lz77-compress, lz77-compression-algorithm, lz77-encoding, node, nodejs, text-compression, typescript, web
- Language: TypeScript
- Homepage: https://docs.amaui.me/library/lz77
- Size: 317 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
amaui LZ77
Own implementation of LZ77, Abraham Lempel and Jacob Ziv's loseless data compression algorithm
MIT license
Production ready
UMD 10.6kb gzipped
100% test cov
Browser and Nodejs
Very simple code
Modern code
Junior friendly
Typescript
Made with :yellow_heart:
## Getting started
### Add
```sh
yarn add @amaui/lz77
```### Use
```javascript
import AmauiLz77 from '@amaui/lz77';// Make a new lz77 instance with a value
const amauiLz77 = new AmauiLz77('Lorem u ipsum dolor sit amet amet amet amet amet amet amet, consectetur adipiscing elit. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus.');// Encoded
// or very simply amauiLz77.response
const response = amauiLz77.encoded;// {
// "value": " Lorem u ipsum dolor sit ame`5,v`, consectetur adipiscing elit. Proin egestas mauris elit,`2o,a`molestie nisi semper at. Cras interdum massa nec `1d,9`rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus.`57,fl`",
// "original_byte_size": 836,
// "value_byte_size": 250,
// "compression_ratio": 3.34,
// "compression_percentage": 70.1,
// "positive": true,
// "performance_milliseconds": 14,
// "performance": "14 milliseconds"
// }// Decode
// with amauiLz77.decode or amauiLz77.decode a static method
AmauiLz77.decode(response.value);// {
// "value": "Lorem u ipsum dolor sit amet amet amet amet amet amet amet, consectetur adipiscing elit. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi aumus.",
// "original_byte_size": 836,
// "value_byte_size": 250,
// "performance_milliseconds": 1,
// "performance": "1 millisecond"
// }
```### Dev
Install
```sh
yarn
```Test
```sh
yarn test
```### Prod
Build
```sh
yarn build
```