Socket
Socket
Sign inDemoInstall

node-readability

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-readability - npm Package Compare versions

Comparing version 0.0.6 to 0.0.8

.travis.yml

10

package.json
{
"name": "node-readability",
"version": "0.0.6",
"version": "0.0.8",
"author": "Zihua Li",

@@ -12,3 +12,3 @@ "description": "Turning any web page into a clean view.",

"scripts": {
"test": "./node_modules/mocha/bin/mocha"
"test": "mocha -R spec"
},

@@ -23,7 +23,7 @@ "main": "./src/readability",

"dependencies": {
"fetch": "0.2.x",
"jsdom": "0.2.x"
"fetch": "0.3.x",
"jsdom": "0.6.x"
},
"engines": [
"node >=0.5.10"
"node >=0.6.0"
],

@@ -30,0 +30,0 @@ "keywords": [

@@ -5,2 +5,4 @@ # node-readability

[![Build Status](https://travis-ci.org/luin/node-readability.png?branch=master)](https://travis-ci.org/luin/node-readability)
## Install

@@ -7,0 +9,0 @@

@@ -18,3 +18,3 @@ // All of the regular expressions in use within readability.

exports.debug = function (debug) {
dbg = (debug) ? console.log : function () {}
dbg = (debug) ? console.log : function () {};
};

@@ -25,3 +25,3 @@

* This includes things like stripping javascript, CSS, and handling terrible markup.
*
*
* @return void

@@ -114,3 +114,3 @@ **/

// EXPERIMENTAL
node.childNodes.forEach(function (childNode) {
node.childNodes._toArray().forEach(function (childNode) {
if (childNode.nodeType == 3 /*TEXT_NODE*/ ) {

@@ -117,0 +117,0 @@ // use span instead of p. Need more tests.

@@ -98,2 +98,3 @@ var jsdom = require('jsdom');

if (errors) return callback(errors);
if (!window.document.body) return callback(new Error('No body tag was found.'));
callback(null, new Readability(window.document, options));

@@ -100,0 +101,0 @@ }

@@ -14,2 +14,16 @@ var readability = require('../src/readability');

});
it('should get document with frames', function (done) {
readability.read('http://www.whitehouse.gov/', function(err, read) {
if (err) return done(err);
var dom = read.getDocument();
read.getTitle().should.equal('The White House');
done();
});
});
it('should handle the html that missing body tag', function (done) {
readability.read('<html><head><title>hi</title></head>hi!</html>', function (err, read) {
err.message.should.equal('No body tag was found.');
done();
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc