readability-from-string
Run mozilla/readability on an HTML string
This is just a convenience wrapper around mozilla/readability.
Installation
Install readability-from-string
using npm:
npm install --save readability-from-string
Usage
Module usage
const readabilityFromString = ; const html = ` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Your html</title> </head> <body> <article> ... </article> </body> </html>`;const result = ;
API
readabilityFromString(html, options)
Name | Type | Description |
---|---|---|
html | String |
The HTML to run Readability on |
options | Object |
Options |
Returns: Object
on success or NULL
when no content was found.
options.href
Type: String
Required: true
Should contain the full URL for the HTML source. This is used to fix relative paths within the HTML.
License
MIT © Joakim Carlstein