Registry / devops / hyperbuild

hyperbuild

JSON →
library0.2.3jsnpmunverified

Hyperbuild is a fast, one-pass, allocation-less HTML minifier written in Rust with context-aware whitespace handling. Current stable version 0.2.3 was released in 2020 and targets Node.js 8–14. It outperforms alternatives like html-minifier and minimize by avoiding AST/tree building and heap allocation during processing. Supports JS minification via esbuild integration, and provides CLI, Rust library, and native bindings for Node.js, Python, Java, and Ruby. Has extensive fuzzing and test suites. Note: package is in maintenance mode with no recent updates; Node.js bindings only work with older Node.js versions.

npm install hyperbuild
INSTALL
IMPORT
SIG · HYPERBUILD
H
hyperbuild
devopsjavascriptv0.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const hyperbuild = require('hyperbuild')
import hyperbuild from 'hyperbuild'
Package is CJS only; ESM import is not supported for Node.js versions < 12. For newer Node.js, you must use dynamic import or a CJS wrapper.
minify
hyperbuild.minify(htmlString, config)
hyperbuild.minify() with no config or wrong config shape
Config object must match Cfg struct in Rust; e.g., { minifyJs: true/false }.
minifyInPlace
hyperbuild.minifyInPlace(buffer)
hyperbuild.minifyInPlace(string) (requires Buffer)
Operates on Buffer for zero-copy; does not return new value, modifies in place.

Minifies HTML string using Node.js native module with config disabling JS minification.

const hyperbuild = require('hyperbuild'); const cfg = { minifyJs: false }; const input = '<p> Hello, world! </p>'; const minified = hyperbuild.minify(input, cfg); console.log(minified); // '<p> Hello, world! </p>'
Debug
Known issues
deprecatedPackage is in maintenance mode with no updates since 2020; only supports Node.js 8–14.
fix
Consider using a maintained alternative like html-minifier-terser or SWC minifier.
affects: 0.2.3
breakingNode.js engine requirement: >=8 <=14. Does not work with Node.js 15+ due to native module ABI break.
fix
Use Node.js 14 or earlier, or avoid the package.
affects: >=0.1.0
gotchaminifyJs config only works if esbuild is installed; does not fail gracefully if missing.
fix
Always set minifyJs: false unless you have esbuild as a dependency.
affects: >=0.2.0
gotchaminifyInPlace modifies the original Buffer; no new Buffer returned.
fix
Use minify for safe operations on strings.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Module did not self-register: 'hyperbuild.node'
Native module binary is incompatible with the current Node.js version (ABI mismatch).
fix
Install using a Node.js version between 8 and 14, or rebuild the native module from source.
TypeError: hyperbuild.minify is not a function
Import failed; package might not be installed or is a different version.
fix
Use require('hyperbuild') and ensure the package is installed; if using bundlers, check that native modules are not bundled.
Error: Cannot find module 'hyperbuild'
Package not installed or node_modules missing.
fix
Run npm install hyperbuild --save
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies
esbuildoptionalUsed for JavaScript minification when enabled in config
Agent activity
6 hits · last 30 days
node
6
Resources
hyperbuild — npm install hyperbuild · libregistry