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

@mindcrunch4u/h5p-html-exporter

v10.0.8

Published

A community re-implementation of the H5P server

Readme

@lumieducation/h5p-html-exporter

The H5P HTML exporter is a component meant to be used in a server running @lumieducation/h5p-server. It creates self-contained and minified HTML bundles that can be used to distribute H5P content without a H5P compatible online system.

Library file patches

Some H5P library files contain code that is incompatible with the export process (e.g. syntax that breaks the JavaScript minifier) or causes runtime issues in the exported HTML bundle. The exporter ships with built-in patches for known issues and allows you to provide your own custom patches.

How patches work

Patches are simple text replacements (string or regex) applied to library file content before minification and PostCSS processing. Each patch targets a specific library by machine name, an optional version range, and a filename within the library.

Both JavaScript and CSS files can be patched.

Built-in patches

The following patches are included and applied automatically:

| Library | File | Description | | ------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------- | | H5P.Echo360 | echo360.js | Replaces delete previousTickMS with previousTickMS = undefined to prevent uglifyJs from throwing an error in strict mode. |

Providing a custom patch list

Pass the complete patch list via the libraryPatches option of the HtmlExporter constructor. When this option is omitted, the built-in patches are used automatically.

import HtmlExporter, {
    ILibraryFilePatch,
    builtInPatches
} from '@lumieducation/h5p-html-exporter';

const exporter = new HtmlExporter(
    libraryStorage,
    contentStorage,
    config,
    coreFilePath,
    editorFilePath,
    {
        libraryPatches: [
            ...builtInPatches, // keep all built-in patches
            {
                machineName: 'H5P.SomeLibrary',
                filename: 'scripts/main.js',
                search: 'brokenFunction()',
                replace: 'fixedFunction()',
                patchReason: 'Fix broken function call that crashes the export'
            }
        ]
    }
);

Because you control the full list, you can also replace or drop built-in patches by simply not including them:

// Only apply your own patch — built-in patches are not used
const exporter = new HtmlExporter(
    libraryStorage,
    contentStorage,
    config,
    coreFilePath,
    editorFilePath,
    {
        libraryPatches: [
            {
                machineName: 'H5P.Echo360',
                filename: 'echo360.js',
                search: 'delete previousTickMS',
                replace: '/* custom fix */'
            }
        ]
    }
);

Patch options

| Property | Type | Required | Description | | ------------- | -------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | machineName | string | Yes | The H5P library machine name (e.g. "H5P.Echo360"). | | filename | string | Yes | Filename to match. Matched as an exact path or path-segment suffix, so "echo360.js" matches "echo360.js" and "js/echo360.js" but not "notecho360.js". | | search | string \| RegExp | Yes | The pattern to find. Literal strings are matched exactly. RegExp supports flags and capture groups. | | replace | string | Yes | The replacement text. Supports $1, $2, etc. for regex capture groups. | | minVersion | { majorVersion, minorVersion } | No | Minimum library version (inclusive). If omitted, no lower bound. | | maxVersion | { majorVersion, minorVersion } | No | Maximum library version (inclusive). If omitted, no upper bound (applies to all future versions). | | replaceAll | boolean | No | Replace all occurrences instead of just the first. Default: false. | | patchReason | string | No | Human-readable explanation of why the patch exists. |

Version ranges

H5P libraries use a two-part versioning scheme (major.minor). Version range matching is intentionally permissive: if you omit maxVersion, the patch applies to all future versions of the library. This is the recommended default, since you typically cannot predict when a library author will fix the issue you are patching around.

// Applies to H5P.Example versions 1.2 through 3.5 (inclusive)
{
    machineName: 'H5P.Example',
    filename: 'example.js',
    minVersion: { majorVersion: 1, minorVersion: 2 },
    maxVersion: { majorVersion: 3, minorVersion: 5 },
    search: 'old',
    replace: 'new'
}

// Applies to all versions (recommended when unsure)
{
    machineName: 'H5P.Example',
    filename: 'example.js',
    search: 'old',
    replace: 'new'
}

Support

This work obtained financial support for development from the German BMBF-sponsored research project "CARO - Care Reflection Online" (FKN: 01PD15012).

Read more about them at the following websites: