npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

readability-extended

v1.0.0

Published

Turning any web page into a clean view.

Downloads

9

Readme

Readability

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

Features

  1. Optimized for more websites.
  2. Supporting HTML5 tags(article, section) and Microdata API.
  3. Focusing on both accuracy and performance. 4x times faster than arc90's version.
  4. Supporting encodings such as GBK and GB2312.
  5. Extended mode give you access to all meta tags and to whole document (you have possibility to parse any element from webpage)

Install

$ npm install readability-extended

Usage

read(html [, options], callback)

Where

  • html url or html code.
  • callback is the callback to run - callback(error, article, meta)
  • options {extendMode: true}

Example

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

read('http://howtonode.org/really-simple-file-uploads', function(err, article, meta) {
  // Main Article
  console.log(article.content);
  
  // Title
  console.log(article.title);
  
  //uri
  console.log(article.uri);
  
  //lead_image_url
  console.log(article.lead_image_url);
  
  //excerpt
  console.log(article.excerpt);
  
  //redirection -- boolean tells redirection is happening or not
  console.log(article.redirection);
  
  //Author
  console.log(article.byline);
  
  //canonical_url
  console.log(article.canononicalUrl);

  // meta tags
  console.log(article.metaData);

  //document - jsdom object
  console.log(article.articleContent);

  // Response Object from Request Lib
  console.log(meta);
});
read('http://howtonode.org/really-simple-file-uploads', function(err, article, meta) {
  if(:werr){
    console.log(err);
    if(err.status >= 400 && err.status < 511){
      console.log("Page not found");
    }
  }
});

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.

article object

content

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

title

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

uri

The article uri of the web page.

lead_image_url

The article main image of web page. Pick from meta tag og:image.

excerpt

The article expert of web page.

redirection

boolean tells redirection is happening or not.

Author

The article author of web page.

meta object

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