Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Readability - docs example fixed
var Readability = require('Readability');
var JSDOM = require('jsdom').JSDOM;
var doc = new JSDOM("<body>Here's a bunch of text</body>", {
url: "",
let reader = new Readability(doc.window.document);
let article = reader.parse();
Copy link

buley commented Jan 28, 2019

(master)⚡ % node fixed.js                      ~/Documents/Code/birch/api/test
{ title: '',
  byline: null,
  dir: null,
   '<div id="readability-page-1" class="page">Here\'s a bunch of text</div>',
  textContent: 'Here\'s a bunch of text',
  length: 22,
  excerpt: undefined,
  siteName: null }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment