node package manager


Turning any web page into a clean view.


Turn any web page into a clean view. This module is based on arc90's readability project.

  1. Optimized for more websites.
  2. Support encodings such as GBK and GB2312.
  3. Converts relative urls to absolute for images and links automatically(Thank Guillermo Baigorria & Tom Sutton).
npm install node-readability

read(html [, options], callback)


  • html url or html code.
  • options is an optional options object
  • callback is the callback to run - callback(error, article, meta)


var read = require('node-readability');

read('', function(err, article, meta) {
  // The main body of the page.
  // The title of the page.

  // The raw HTML code of the page
  // The document object of the page
  // The response object from request lib

NB If the page has been marked with charset other than utf-8, it will be converted automatically. Charsets such as GBK, GB2312 is also supported.

node-readability will pass the options to request directly. See request lib to view all available options.

node-readability has additional option cleanRules which allow set your own validation rule for tags. If true rule is valid, otherwise no. options.cleanRules = [callback(obj, tagName)]

read(url, {
        cleanRulers : [
          function(obj, tag) {
            if(tag === 'object') {
              if(obj.getAttribute('class') === 'BrightcoveExperience') {
                return true;
      }, function(err, article, response) {});

article object

The article content of the web page. Return false if failed.

The article title of the web page. It's may not same to the text in the <title> tag.

The original html of the web page.

The document of the web page generated by jsdom. You can use it to access the DOM directly(for example, article.document.getElementById('main')).

response object from request lib. If you need to get current url after all redirect or get some headers it can be useful.

This code is under the Apache License 2.0.