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

hdf5-io

v0.0.33

Published

Simple utility for reading / writing HDF5 files

Downloads

40

Readme

hdf5-io

Simple utility for reading / writing HDF5 files on the browser

status downloads lic

Description

hdf5-io is a simple utility for handling reading / writing HDF5IO files. As an extension to the h5wasm library, it immediately emits and consumes JavaScript objects containing all the relevent data.

Getting Started


// Import hdf5-io Library
import HDF5IO from "https://cdn.jsdelivr.net/npm/hdf5-io/dist/index.esm.js";

// Initialize HDF5IO instance (all optional parameters)
const io = new HDF5IO(
    {
        postprocess: (hdf5Object) => hdf5Object,
        debug: true
    },
    
)

await io.initFS('/hdf5-test') // initialize local filesystem

// load a remote file
const file = await io.fetch(
     'https://raw.githubusercontent.com/OpenSourceBrain/NWBShowcase/master/FergusonEtAl2015/FergusonEtAl2015.nwb', // URL to get file from
    'FergusonEtAl2015.nwb',  // Save the file with this name
    (ratio) => console.log('Load Status', `${(ratio * 100).toFixed(2)}%`),
    (remote) => console.log('Origin', (remote) ? path : 'Local')
)

// save the file to local storage
const filename = io.save(file)

// list files in local storage
const files = await io.list()

// get specific file from local storage
const lsFile = await io.load(filename)

Conventions

Datasets

When reading an HDF5 file, both datasets and attributes are transformed into JavaScript objects that hold their respective metadata:

const datasetValue = 1 // From HDF5 file
const output = new Number(datasetValue)

If you are adding a new dataset, this must be an Object when written to the file:

const object = {
    dataset: new Number(1),
    attribute: 1
}

Known Issues

  • Files that previous could be streamed (e.g. https://dandiarchive.s3.amazonaws.com/blobs/aff/5f6/aff5f64d-9a69-4ff3-a6fe-13a3f30dca50) no longer work
  • Node.js doesn't work when bundled—unless you manually provide a h5wasm instance
  • Streaming doesn't work in Node.js

Acknowledgments

hdf5-io was originally prototyped by Garrett Flynn as the WebNWB project at the 2022 NWB-DANDI Remote Developer Hackathon.