README
Readability
There are two options to parse a document
you must create a new Readability
object from a DOM document object, and then call parse()
. Here's an example:
const JSDom = require("jsdom").JSDOM;
const { Readability } = require("dom-readability");
var document = new JSDom(html).window.document;
var article = new Readability(document).parse();
This article
object will contain the following properties:
title
: article titlecontent
: HTML string of processed article contentlength
: length of an article, in charactersexcerpt
: article description, or short excerpt from the contentbyline
: author metadatadir
: content direction
if you don't want to parse the DOM you can use the following method
const { Parse } = require("dom-readability");
var article = Parse(html);