Help
Using the playground
Paste a full HTML page or a fragment into the input box and choose how aggressively to strip boilerplate. Click Clean HTML to get the cleaned HTML back, along with the detected page type and confidence. Copy or download the result, or switch What to do to npm CLI or npm library to generate the command or TypeScript code that reproduces the same settings.
The engine runs server-side and never fetches the network ā there is no URL input and no crawling. It takes the HTML you paste and returns cleaned HTML.
Boilerplate modes
- Precision ā strictest; drops the most, keeping only high-confidence main content.
- Balanced ā the default; a middle ground between precision and recall.
- Recall ā keeps more content, at the risk of some boilerplate.
- Keep boilerplate ā skips main-content extraction and only sanitizes and normalizes the whole document.
Content handling
Choose what becomes of images, links, tables, and comments ā each defaults to keep. Images additionally support alt-text (each image becomes its textual stand-in) and resolved-url (one clean <img> per image with a resolved absolute src; the optional Source URL is used for absolutization and is never fetched). Comment retention follows the detected page type, so strip there is a soft no-op. The output is minified by default ā uncheck Minify output for pretty-printed HTML. Each mode maps directly to a CLI flag and a library option.
npm CLI
npm install -g trafilaturacore
echo '<html>ā¦</html>' | trafilaturacore -b balanced --image-handling strip
The CLI reads HTML from a file argument or stdin and writes cleaned HTML to stdout. Output is minified by default ā add --no-minify for pretty-printed HTML, or --json for the full result (HTML, metadata, page type, confidence).
TypeScript library
npm install trafilaturacore
import { clean } from "trafilaturacore";
const { html, pageType, confidence } = await clean(inputHtml, {
boilerplate: "balanced",
imageHandling: "strip",
});
Alpha status
trafilaturacore is an alpha, experimental build ā maintained, but not yet a stable release. APIs may still change. The source is on GitHub and the package is on npm.
Updated: July 11, 2026