Skip to content

Installation

Efra Espada edited this page Nov 9, 2024 · 1 revision

Installation Guide

This guide covers the installation and setup for the Zstandard plugin and CLI across various platforms.

Flutter Plugin Installation

  1. Add the Dependency: In your pubspec.yaml file, add the zstandard plugin.
dependencies:
  zstandard: ^1.4.0        # android   ios   linux   macos   windows   web
  1. 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>

CLI Installation

  1. Add the CLI Package: For Dart-only projects, add the following to pubspec.yaml:
dependencies:
  zstandard_cli: ^1.4.0    #                 linux   macos   windows
  1. Run dart pub get to install the CLI.

  2. CLI Commands: To use the CLI, run:

dart run zstandard_cli:compress <file> <compression_level>
dart run zstandard_cli:decompress <file.zstd>
Clone this wiki locally