tabletojson
Advanced tools
Comparing version 0.9.4 to 0.9.5
'use strict'; | ||
const AbstractToJson = require('pagetojson').AbstractToJson; | ||
const cheerio = require('cheerio'); | ||
const request = require('request'); | ||
class tabletojson { | ||
class tabletojson extends AbstractToJson { | ||
/** | ||
@@ -180,3 +180,3 @@ * Static conversion of a given HTML Page | ||
// Use a callback (if passed) | ||
const html = await tabletojson.fetchUrl(url, requestOptions); | ||
const html = await AbstractToJson.fetchUrl(url, requestOptions); | ||
return callback.call(this, tabletojson.convert(html, options)); | ||
@@ -188,3 +188,3 @@ } else if (typeof arg1 === 'function') { | ||
// Use a callback (if passed) | ||
const html = await tabletojson.fetchUrl(url); | ||
const html = await AbstractToJson.fetchUrl(url); | ||
return callback.call(this, tabletojson.convert(html, options)); | ||
@@ -197,3 +197,3 @@ } else { | ||
requestOptions = options.request || {}; | ||
const html = await tabletojson.fetchUrl(url, requestOptions); | ||
const html = await AbstractToJson.fetchUrl(url, requestOptions); | ||
return tabletojson.convert(html, options); | ||
@@ -203,12 +203,2 @@ } | ||
static fetchUrl(url, options) { | ||
return new Promise((resolve, reject) => { | ||
request(url, options, function(error, response, body) { | ||
if (error) { | ||
reject(error); | ||
} | ||
resolve(body); | ||
}); | ||
}); | ||
} | ||
} | ||
@@ -215,0 +205,0 @@ |
@@ -9,3 +9,3 @@ { | ||
"description": "Converts HTML tables to JSON objects", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"main": "./lib/tabletojson.js", | ||
@@ -22,7 +22,7 @@ "keywords": [ | ||
"type": "git", | ||
"url": "git://github.com/iaincollins/tabletojson.git" | ||
"url": "git://github.com/maugenst/tabletojson.git" | ||
}, | ||
"dependencies": { | ||
"cheerio": "^1.0.0-rc.2", | ||
"request": "^2.85.0" | ||
"pagetojson": "^0.0.2" | ||
}, | ||
@@ -41,4 +41,4 @@ "engines": { | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"nyc": "^11.7.1", | ||
"prettier": "^1.12.1", | ||
"nyc": "^11.9.0", | ||
"prettier": "^1.13.5", | ||
"should": "^13.2.1" | ||
@@ -45,0 +45,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61391
845
+ Addedpagetojson@^0.0.2
+ Addedpagetojson@0.0.2(transitive)
- Removedrequest@^2.85.0