markdown-lite-worker
v1.0.1
Published
A package to fetch HTML, clean it, convert it to Markdown, and extract metadata.
Downloads
154
Maintainers
Readme
My HTML to JSON Package
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).
Installation
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();