
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
readability-js
Advanced tools
Nodejs module for extracting web page content using Cheerio.
Turn any web page into a clean view. This module is based on luin's readability project.
npm install readability-js
read(html [, options], callback)
Where
var read = require('readability-js');
read('http://howtonode.org/really-simple-file-uploads', function(err, article, meta) {
// Main Article
console.log(article.content.text());
// Title
console.log(article.title);
// Article HTML Source Code
console.log(article.content.html());
});
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.
readability-js will pass the options to request directly. See request lib to view all available options.
readability-js has 2 additional options:
onlyArticleBody (Boolean) - get only article body or all main content;
preprocess - which should be a function to check or modify downloaded source before passing it to readability.
read(url, {
preprocess: function(source, response, contentType, callback) {
if (source.length > maxBodySize) {
return callback(new Error('too big'));
}
callback(null, source);
}, function(err, article, response) {
//...
});
content - The article content of the web page. Return false if failed. Is a Cheerio object.
title - The article title of the web page. It's may not same to the text in the <title> tag.
excerpt - The article description from any description, og:description or twitter:description <meta>
FAQs
Turning any web page into a clean view.
We found that readability-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.