From 79f84e2cd0dec6a6ea512f66bd2bd90c2ae39dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateo=20Guzm=C3=A1n?= Date: Sun, 29 Sep 2024 19:16:00 +0200 Subject: [PATCH] docs(readme): providing up-to-date example --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7010063..6119f22 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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