The URL of the web page to read and convert
Optionaloptions: ReaderOptionsOptional configuration for fetching and processing
Options for reading and converting web pages. Extends FetchOptions to inherit timeout, retries, and retryDelay.
Optionaltimeout?: numberRequest timeout in milliseconds (default: 30000)
Optionalretries?: numberNumber of retry attempts on failure (default: 3)
OptionalretryDelay?: numberDelay between retries in milliseconds (default: 1000)
Promise resolving to ConversionResult with content in all three formats
// Basic usage
const result = await readURL('https://example.com/article');
console.log(result.markdown); // Markdown version
console.log(result.plainText); // Plain text version
console.log(result.readableHTML); // Clean HTML version
// With custom options
const result = await readURL('https://example.com/article', {
timeout: 60000,
retries: 5
});
// Access metadata
console.log(result.title); // Article title
console.log(result.byline); // Author
console.log(result.publishedTime);// Publication date
Reads a URL and converts it to readable HTML, plain text, and markdown.
This is the main entry point for the mdfetch library. It orchestrates the complete pipeline:
Features: