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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@missing-elements/h5p-normalize

v0.1.1

Published

Rewrites an .h5p package so it streams: media stored, mp4 index first, libraries before content. The content is not changed.

Readme

@missing-elements/h5p-normalize

Rewrites an .h5p package once so that it streams well through h5p-offline-player. The content is not changed; only the zip container is:

  • media (video, audio, images, fonts, PDF) is stored rather than deflated, so a Range request can reach any byte of it directly;
  • an mp4 whose index (moov) sits at the end is remuxed so the index comes first — a remux, not a re-encode;
  • entries are ordered h5p.json, library folders, content, with content media last, so a host that ignores Range still boots the player before the media has arrived;
  • scripts, styles and JSON an exporter left stored are deflated; everything else is copied byte for byte.

Run it once, where the package is published — not in the learner's browser.

Usage

Needs Node 20 or later.

npx @missing-elements/h5p-normalize course.h5p               # writes course.normalized.h5p
npx @missing-elements/h5p-normalize course.h5p --dry-run     # report only, write nothing
npx @missing-elements/h5p-normalize https://host.example/course.h5p -o course.h5p

Or install it, and the command is h5p-normalize:

npm install --save-dev @missing-elements/h5p-normalize
npx h5p-normalize course.h5p

| Option | | |---|---| | -o, --output <file> | where to write; default <name>.normalized.h5p beside the input, or in the current directory for a URL | | -n, --dry-run | inspect and report, write nothing | | -q, --quiet | only the summary | | -h, --help | |

The output is checked as it is written: an entry whose bytes do not match their CRC stops the run with its name, and an encrypted entry is refused rather than copied without its key data. unzip -t course.normalized.h5p is an independent check.

The summary has a revision line: what h5p-offline-player will put in context.revision on every xAPI statement for the file it wrote (for a dry run, the input as it is). Copy it into your version record at release, and an audit can match each completion to the build it came from. archiveFingerprint(path) returns the same from code.

From code

import { normalizeArchive, formatBytes } from '@missing-elements/h5p-normalize'

const report = await normalizeArchive({
  input: 'course.h5p',
  output: 'course.normalized.h5p', // omit for a dry run
  onEntry: (result) => console.log(result.name, result.action)
})

normalizeArchive reads and writes files on disk; it runs on Node, not in a browser.

Why

A deflated video cannot be read from the middle: every byte before the one a player seeks to has to be downloaded and inflated first. If the mp4 also keeps its index at the end, nothing plays until the last byte has arrived. The demo site's normalize page explains it with a diagram, and the repository's AGENTS.md records what the tool does and does not change.

Licence

MIT. Its one dependency, zip.js, is BSD-3-Clause and is installed alongside it, not bundled.