@stephansama/single-file
Fetch any webpage and produce a fully self-contained HTML file with all external resources — images, stylesheets, scripts, and SVGs — inlined directly into the document.
Table of contents
Section titled “Table of contents”Open Table of contents
Installation
Section titled “Installation”pnpm install @stephansama/single-file# outputs to single-file.html by defaultnpx @stephansama/single-file <url>
# custom output pathnpx @stephansama/single-file <url> --output my-page.htmlnpx @stephansama/single-file <url> -o my-page.html
# verbose loggingnpx @stephansama/single-file <url> --verbosenpx @stephansama/single-file <url> -v| Flag | Alias | Default | Description |
|---|---|---|---|
--output | -o | single-file.html | Output path for the HTML file |
--verbose | -v | false | Enable verbose output |
import * as singleFile from "@stephansama/single-file";
export async function useAPI() { const file = await singleFile.convertPageToSingleFile( "https://blog.stephansama.info", );
console.info(file);}Modules
Section titled “Modules”| Module | Description |
|---|---|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |
|
|
‐ |