markdown-lite-worker
is a simple npm package that fetches an HTML page from a given URL, cleans unwanted tags and inline styles, converts the HTML to Markdown, and extracts basic metadata (title, language, source URL, status code).
You can install this package via npm:
npm install markdown-lite-worker
Example
import { fetchHtmlToJson } from "markdown-lite-worker";
async function fetchData() { const url = "https://example.com"; const result = await fetchHtmlToJson(url);
if (result.success) { console.log("Markdown:", result.data.markdown); console.log("Metadata:", result.data.metadata); } else { console.error("Failed to fetch data:", result.error); } }
fetchData();