urltoany
v0.1.1
Published
Convert any URL to Markdown, Text, HTML, or JSON. A lightweight utility for extracting web content.
Maintainers
Readme
urltoany
Convert any URL to Markdown, Text, HTML, or JSON. Zero dependencies, TypeScript-first.
Try the full web version at urltoany.com — with 12+ conversion formats, AI summarization, SEO analysis, and more.
Install
npm install urltoanyUsage
import { toMarkdown, toText, toHTML, toJSON } from 'urltoany'
// Get page content as Markdown
const markdown = await toMarkdown('https://example.com')
// Get plain text
const text = await toText('https://example.com')
// Get cleaned HTML
const html = await toHTML('https://example.com')
// Get structured JSON (title, description, content, etc.)
const json = await toJSON('https://example.com')Options
All functions accept an optional second argument:
const markdown = await toMarkdown('https://example.com', {
timeout: 60000, // request timeout in ms (default: 30000)
headers: { // custom headers
'Accept-Language': 'en-US',
},
})API
toMarkdown(url, options?): Promise<string>
Extracts the main content from a URL and returns it as Markdown.
toText(url, options?): Promise<string>
Extracts plain text content from a URL, stripped of all formatting.
toHTML(url, options?): Promise<string>
Returns the cleaned HTML content from a URL.
toJSON(url, options?): Promise<JsonResult>
Returns structured data including title, description, URL, and content.
interface JsonResult {
title: string
description: string
url: string
content: string
[key: string]: unknown
}Requirements
- Node.js >= 18 (uses native
fetch)
More Features
Need more? urltoany.com offers:
- URL to PDF & Image (screenshots)
- URL to QR Code
- AI-powered content summarization
- SEO analysis (headings, meta tags)
- URL extraction from sitemaps
- And more — all free, no registration required
License
MIT
