This package, `zstd-napi`, provides high-performance TypeScript bindings to the native Zstandard (zstd) compression library, utilizing the Node-API (N-API) for native addon interfacing. As of its latest stable version, `0.0.12`, the library emphasizes reliability and performance, having been proven in production environments with invocation rates exceeding a million times per second. While a specific release cadence isn't explicitly stated, the frequent minor version bumps (0.0.3 to 0.0.12 in recent history) suggest active development. Key differentiators include comprehensive exposure of the stable Zstandard API, supporting advanced features like dictionary compression and multithreading, and offering both high-level and low-level APIs. It ships with pre-built binaries for common platforms and provides robust Node.js version support, including current and active LTS releases, making it a reliable choice for high-throughput compression tasks in Node.js applications.
npm install zstd-napiVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic Zstandard compression and decompression using `zstd-napi`'s high-level API, including writing and reading compressed data to a temporary file, and showing how to apply a specific compression level.
Ensure you have a C++ compiler (like GCC or Clang) and Python 3.x installed and configured for `node-gyp` to build from source. On Windows, this typically involves installing Visual Studio Build Tools.
Refer to the official Node.js release schedule and the `zstd-napi` support policy to use a compatible and supported Node.js version. Upgrade Node.js if encountering issues related to ABI compatibility.
For most applications, use the high-level API imported directly from `zstd-napi`. Only utilize the low-level API if you fully understand its implications and require fine-grained control over memory and Zstandard parameters.
Run `npm rebuild zstd-napi` to recompile the native module against your current Node.js version, or ensure you are using a Node.js version for which a pre-built binary is available.
Ensure `npm install zstd-napi` completed successfully. If building from source, verify your C++ compiler setup. For TypeScript, check your `tsconfig.json` for correct `moduleResolution` and `typeRoots` settings, though types are generally shipped with the package.
Install the necessary C++ build tools for your operating system. On Windows, use `npm install --global windows-build-tools`. On macOS, install Xcode Command Line Tools. On Linux, install `build-essential` or equivalent packages.
No dependency data recorded yet.