npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

h5wasm-plugins

v0.0.3

Published

compression plugins for h5wasm

Downloads

148

Readme

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;
// installs libH5Zzfp.so to default folder, /usr/local/hdf5/lib/plugin
install_plugins(h5wasm, ["zfp"]);

// Or, to install all plugins to new folder /tmp/h5plugins
// install_plugins(h5wasm, plugin_names, "/tmp/h5plugins");

// open existing file - see h5wasm docs for writing files to
// virtual Emscripten filesystem
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;
// this inserts the node_modules/h5wasm-plugins/plugins path
// at the start of the HDF5 plugin search paths
h5wasm_plugins.install_local_plugins(h5wasm);

const f = new h5wasm.File('./test_zfp.h5', 'r');
// File {
//   path: '/',
//   file_id: 72057594037927936n,
//   type: 'Group',
//   filename: './test_zfp.h5',
//   mode: 'r'
// }

f.get('data').filters
// [
//   {
//     id: 32013,
//     name: 'H5Z-ZFP-1.1.0 (ZFP-0.5.5)',
//     cd_values: [ 89149712, 91252346, 146, 4293918720, 3767009280, 493487 ]
//   }
// ]

f.get('data').value 
// Float32Array(10) [
//   0, 1, 2, 3, 4,
//   5, 6, 7, 8, 9
// ]

h5wasm.Module.get_plugin_search_paths()
// [
//   '/home/bbm/dev/test_plugins/node_modules/h5wasm-plugins/plugins',
//   '/usr/local/hdf5/lib/plugin'
// ]

Building from source

Dependencies:

  1. cmake >= 3.24
  2. make
  3. emscripten, preferably version 3.1.43

run make to build the plugins to the plugins folder locally.