Skip to content

Commit

Permalink
docs(readme): providing up-to-date example
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoguzmana committed Sep 29, 2024
1 parent 7cf6b47 commit 79f84e2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

LZ4 – React Native bindings for an extremely fast compression algorithm.

Compress and decompress files using the LZ4 algorithm in React Native. This library binds the [LZ4 C library](https://github.com/lz4/lz4) to React Native via C++ TurboModules.

The library could also be extended to support other LZ4 features if needed.

## Installation

```sh
Expand All @@ -13,10 +17,14 @@ npm install react-native-lz4
```ts
import { compressFile, decompressFile } from 'react-native-lz4';

const didCompress = await compressFile('path/to/file', 'path/to/output');
const didDecompress = await decompressFile('path/to/file', 'path/to/output');
const compressionResult = await compressFile('path/to/file', 'path/to/output');
const decompressionResult = await decompressFile('path/to/file', 'path/to/output');

console.log(compressionResult)
// { success: true, message: 'File compressed successfully', originalSize: 100, finalSize: 50 }

console.log({ didCompress, didDecompress });
console.log(decompressionResult)
// { success: true, message: 'File decompressed successfully', originalSize: 50, finalSize: 100 }
```

## Contributing
Expand Down

0 comments on commit 79f84e2

Please sign in to comment.