h5wasm-plugins
A collection of pre-compiled compression plugins to be used with h5wasm
The plugins are built using sources fetched at build-time from https://github.com/HDFGroup/hdf5_plugins
(if new plugins are desired, it is recommended to get them upstreamed to that repository so they can be built here)
(h5wasm is a javascript/webassembly library for reading and writing HDF5 files from the browser or node.js or deno or...)
Installation
npm install h5wasm-plugins
(this will also install h5wasm >= 0.6.7)
Included plugins
- blosc
- bshuf
- bz2
- lz4
- lzf
- szf
- zfp
- zstd
(Note that gzip
and szip
filters are built-in to h5wasm and don't require a plugin)
Usage: browser
The default export from h5wasm (which has a Module
property defined, for accessing the C-module directly) should be passed to the functions defined here.
import h5wasm from "h5wasm";
import { plugin_names, install_plugins } from "h5wasm-plugins";
await h5wasm.ready;
install_plugins(h5wasm, ["zfp"]);
const f = new h5wasm.File("my_zfp.h5", "r");
const data = f.get("zfp_data").value;
Usage: server side (e.g. nodejs)
const h5wasm = await import("h5wasm");
const h5wasm_plugins = await import("h5wasm-plugins");
await h5wasm.ready;
h5wasm_plugins.install_local_plugins(h5wasm);
const f = new h5wasm.File('./test_zfp.h5', 'r');
f.get('data').filters
f.get('data').value
h5wasm.Module.get_plugin_search_paths()
Building from source
Dependencies:
- cmake >= 3.24
- make
- emscripten, preferably version 3.1.43
run make
to build the plugins to the plugins
folder locally.