Run mozilla/readability on an HTML string
npm install readability-from-string[![Build status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![XO code style][codestyle-image]][codestyle-url]
> Run mozilla/readability on an HTML string
This is just a convenience wrapper around mozilla/readability.
Install readability-from-string using npm:
``bash`
npm install --save readability-from-string
`javascript
const readabilityFromString = require('readability-from-string');
const html =
;
const result = readabilityFromString(html, {href: 'http://original.location.com/of/html.source'});
`API
$3
| 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.hrefType:
String
Required: true`Should contain the full URL for the HTML source. This is used to fix relative paths within the HTML.
MIT © Joakim Carlstein
[npm-url]: https://npmjs.org/package/readability-from-string
[npm-image]: https://badge.fury.io/js/readability-from-string.svg
[travis-url]: https://travis-ci.org/joakimbeng/readability-from-string
[travis-image]: https://travis-ci.org/joakimbeng/readability-from-string.svg?branch=master
[codestyle-url]: https://github.com/sindresorhus/xo
[codestyle-image]: https://img.shields.io/badge/code%20style-XO-5ed9c7.svg?style=flat