1.0.1 • Published 1 year ago
markdown-lite-worker v1.0.1
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-workerExample
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();