The `html` package, currently at version 1.0.0, functions as a command-line utility for pretty-printing HTML code. It is a direct Node.js port of `beautify-html.js`, which itself is based on `jsbeautifier`. The tool is designed primarily for CLI usage, accepting HTML input via `stdin`, file arguments, or interacting with the system clipboard through utilities like `pbpaste` and `pbcopy` on macOS. Its core purpose is to take minified or unformatted HTML and output a human-readable, indented version. Given its last update in 2012, the project is abandoned. Its release cadence is non-existent, and users are instructed to manually update its underlying `jsbeautifier` dependency, indicating a lack of active maintenance and potential compatibility issues with modern JavaScript environments or Node.js versions. There are no notable differentiators over modern HTML formatters beyond its extremely simple, direct CLI piping approach, which is now largely obsolete.
npm install htmlVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use the `html` CLI tool to pretty-print a string of ugly HTML passed via stdin.
For new projects, use a modern HTML beautifier like Prettier or `js-beautify` directly. If absolutely necessary, configure Node.js to load CJS modules in an ESM context, or use `require()` if in a CJS file.
Avoid using this package. Migrate to actively maintained alternatives such as `prettier` for comprehensive code formatting, or a modern `js-beautify` version if a direct replacement is needed.
If programmatic use is unavoidable in TypeScript, create a declaration file (`html.d.ts`) with `declare module 'html' { export function prettyPrint(html: string, options?: any): string; }` or use `@ts-ignore`.Install the package globally: `npm install -g html` or run it via `npx html` to execute without global installation.
If programmatic use is desired, use a modern HTML formatter that supports ESM. If forced to use this package, you must use it in a CommonJS file or configure an ES module loader to interoperate with CJS modules.
Run `npm install html` in your project directory.
No dependency data recorded yet.