rss-parser
Advanced tools
Comparing version 2.1.0 to 2.1.1
19
index.js
@@ -5,3 +5,4 @@ var Entities = require("entities"); | ||
var Request = require('request'); | ||
var HTTP = require('http'); | ||
var HTTPS = require('https'); | ||
@@ -52,7 +53,15 @@ var Parser = module.exports = {}; | ||
Parser.parseURL = function(url, callback) { | ||
Request(url, function(err, resp, body) { | ||
if (err) return callback(err); | ||
if (resp.statusCode !== 200) return callback(new Error('Status code is: ' + resp.statusCode)) | ||
return Parser.parseString(body, callback); | ||
var xml = ''; | ||
var get = url.indexOf('https') === 0 ? HTTPS.get : HTTP.get; | ||
var req = get(url, function(res) { | ||
if (res.statusCode >= 300) return callback(new Error("Status code " + res.statusCode)) | ||
res.setEncoding('utf8'); | ||
res.on('data', function(chunk) { | ||
xml += chunk; | ||
}); | ||
res.on('end', function() { | ||
return Parser.parseString(xml, callback); | ||
}) | ||
}) | ||
req.on('error', callback); | ||
} | ||
@@ -59,0 +68,0 @@ |
{ | ||
"name": "rss-parser", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"main": "index.js", | ||
@@ -17,3 +17,2 @@ "scripts": { | ||
"entities": "^1.1.1", | ||
"request": "^2.67.0", | ||
"xml2js": "^0.4.15" | ||
@@ -20,0 +19,0 @@ }, |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2
499647
11999
10
6
- Removedrequest@^2.67.0
- Removedajv@6.12.6(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.0(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpsl@1.9.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)