google-finance-data
Advanced tools
Comparing version 0.0.3 to 0.0.4
'use strict'; | ||
const puppeteer = require('puppeteer'); | ||
const NestedError = require('nested-error-stacks'); | ||
@@ -24,2 +25,3 @@ function getTextContent(element) { | ||
symbol = symbol.toUpperCase(); | ||
let fetchError = null; | ||
@@ -91,3 +93,3 @@ for (let prefix of symbolPrefix) { | ||
catch (err) { | ||
console.error(err.stack ? err.stack : err) | ||
fetchError = err; | ||
} | ||
@@ -97,6 +99,5 @@ } | ||
browser.close(); | ||
throw new Error(`unable to fetch data for ${symbol}`); | ||
throw new NestedError(`unable to fetch data for ${symbol}`, fetchError); | ||
}; | ||
exports.getSymbol = getSymbol; |
{ | ||
"name": "google-finance-data", | ||
"version": "0.0.3", | ||
"description": "Real-time stock quotes and data from Google Finance for Node.js", | ||
"version": "0.0.4", | ||
"description": "Google Finance API for real-time stock quotes and company data from Google Finance", | ||
"main": "index.js", | ||
@@ -28,4 +28,5 @@ "scripts": { | ||
"dependencies": { | ||
"nested-error-stacks": "2.1.0", | ||
"puppeteer": "1.3.0" | ||
} | ||
} |
@@ -1,3 +0,8 @@ | ||
getSymbol("msft") | ||
var google = require("./index.js"); | ||
google.getSymbol("burp") | ||
.then(data => console.log(JSON.stringify(data, null, 2))) | ||
.catch(err => console.error(err.stack ? err.stack : err)); | ||
.catch(err => { | ||
const errorMessage = err.stack ? err.stack : err; | ||
console.error(errorMessage) | ||
}); |
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
6404
87
2
+ Addednested-error-stacks@2.1.0
+ Addednested-error-stacks@2.1.0(transitive)