Zstandard for Windows
v1.5.7WindowsZstandard 1.5.7 for native Node.js addons on Windows, precompiled for x64 and arm64, Windows 10 or later as @crossbind/port-zstd-win32.
Install
The addons and their loader land in dist; the Node.js playbook has the whole flow.
Usage
The examples the WebAssembly page runs, as Windows compiles them: the same headers and the same calls. They are checked on the WebAssembly build.
Compress and decompress a buffer
The two calls most zstd code makes: ZSTD_compress, and ZSTD_decompress with the original size read back from the frame.
Choose a level, a checksum and a window
A context set up with ZSTD_CCtx_setParameter decides what every frame it writes looks like; ZSTD_getFrameHeader reads the choices back.
Compress small messages with a dictionary
Train once with ZDICT_trainFromBuffer, digest it once with ZSTD_createCDict and ZSTD_createDDict, then compress every message against it.
"Stream a file through zstd" writes its input with m.FS, which Windows does not have; the C++ takes paths, so it works unchanged on files in the app's storage. It runs on the WebAssembly page.
What is different on Windows
crossbind build -p win32links one.nodeaddon per architecture intodist, next to a loader,dist/<name>.native.cjs, thatrequireandimportboth load. A plaincrossbind buildskips it.await initNative()once, then call the classes: calls are synchronous, and no Worker is involved.- The library and the C++ runtime are linked into the addon statically; it needs Windows 10 or later and only DLLs that ship with Windows.
- There is no
m.FS: the C++ reads real paths, and data such asGDAL_DATAorproj.dbis copied todist/data. - The build runs in Docker on any host, a Mac included.
worker_threadsare not supported yet.
Other platforms
- Zstandard overview: the apps, every platform's setup and the packages.
- Zstandard for WebAssembly: browsers, Node.js and edge runtimes.
- Zstandard for Android: React Native apps on Android.
- Zstandard for iOS: React Native apps on iOS.
- Zstandard for macOS: native Node.js addons and Electron on macOS.
- Zstandard for Linux: native Node.js addons on Linux.
- Zstandard for WASI: command-line programs under wasmtime.
Facts on this page come from the port manifests in the repository and from what npm served on beta when the site was built. See the Libraries guide for the full consumer flow.