-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Efra Espada edited this page Nov 9, 2024
·
1 revision
This guide covers the installation and setup for the Zstandard plugin and CLI across various platforms.
-
Add the Dependency: In your
pubspec.yaml
file, add thezstandard
plugin.
dependencies:
zstandard: ^1.4.0 # android ios linux macos windows web
- Web: The Web platform uses WebAssembly.
Ensure zstd.js and zstd.wasm are included in the web
folder of your Flutter project.
Set up your index.html
to load the WebAssembly files correctly.
<!DOCTYPE html>
<html>
<head>
<script src="zstd.js"></script>
</head>
</html>
Include the library inside the
<head>
- Add the CLI Package: For Dart-only projects, add the following to pubspec.yaml:
dependencies:
zstandard_cli: ^1.4.0 # linux macos windows
-
Run
dart pub get
to install the CLI. -
CLI Commands: To use the CLI, run:
dart run zstandard_cli:compress <file> <compression_level>
dart run zstandard_cli:decompress <file.zstd>