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

node-readability-cheerio

v1.0.0

Published

node-readability的cheerio版。支持GBK、GB2312等编码的网页抓取和解析。Turning any web page into a clean view.

Downloads

8

Readme

node-readability-cheerio

node-readability的cheerio版。支持GBK、GB2312等编码的网页抓取和解析。Turn any web page into a clean view. This module is based on arc90's readability project.

contact me

csser.me

Install

npm install node-readability-cheerio

README.md from node-readability:

Usage

readability.read(html [, options], callback)

Where

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

Example

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

readability.read('http://howtonode.org/really-simple-file-uploads', function(err, $) {
    console.log($('body').html());
});

More about '$': https://github.com/MatthewMueller/cheerio#selectors

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

Options

node-readability support all the options that fetch support.

Possible option values

  • maxRedirects how many redirects allowed, defaults to 10
  • disableRedirects set to true if redirects are not allowed, defaults to false
  • headers optional header fields, in the form of {'Header-Field':'value'}
  • maxResponseLength maximum allowed length for the file, the remainder is cut off. Defaults to Infinity
  • method defaults to GET
  • payload request body
  • disableGzip set to false, to disable content gzipping, needed for Node v0.5.9 which has buggy zlib
  • cookies an array of cookie definitions in the form of ['name=val']
  • cookieJar for sharing cookies between requests, see below
  • outputEncoding
  • disableDecoding set to true to disable automatic charset decoding to utf-8
  • overrideCharset set input encoding
  • asyncDnsLoookup use high performance asynchronous DNS resolution based on c-ares instead of a thread pool calling getaddrinfo(3)
  • timeout set a timeout in ms
  • agent pass-through http.request agent parameter

License

This code is under the Apache License 2.0. http://www.apache.org/licenses/LICENSE-2.0