Comparing version 0.0.2 to 0.0.3
@@ -36,18 +36,22 @@ 'use strict'; | ||
self._request = function (query, callback) { | ||
var url = getUrl(query); | ||
try { | ||
var url = getUrl(query); | ||
http.get(url, function (res) { | ||
res.setEncoding('utf8'); | ||
var data = ''; | ||
res.on('data', function (chunk) { | ||
data += chunk; | ||
http.get(url, function (res) { | ||
res.setEncoding('utf8'); | ||
var data = ''; | ||
res.on('data', function (chunk) { | ||
data += chunk; | ||
}); | ||
res.on('end', function () { | ||
callback(null, convertResult(data)); | ||
}); | ||
// consume response body | ||
res.resume(); | ||
}).on('error', function (e) { | ||
throw e; | ||
}); | ||
res.on('end', function () { | ||
callback(convertResult(data)); | ||
}); | ||
// consume response body | ||
res.resume(); | ||
}).on('error', function (e) { | ||
throw e; | ||
}); | ||
} catch (e) { | ||
callback(e); | ||
} | ||
}; | ||
@@ -54,0 +58,0 @@ |
{ | ||
"name": "yfinance", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Yahoo Finance API for NodeJs.", | ||
@@ -56,3 +56,3 @@ "homepage": "https://github.com/johancn87/yf", | ||
}, | ||
"repository": "johancn87/yfinance", | ||
"repository": "johancn87/yf", | ||
"scripts": { | ||
@@ -59,0 +59,0 @@ "prepublish": "gulp prepublish", |
@@ -15,11 +15,14 @@ # yfinance [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url] | ||
yfinance.getQuotes('JNJ', function (data) { | ||
yfinance.getQuotes('JNJ', function (err, data) { | ||
if(err) console.log(err); | ||
//... | ||
}); | ||
yfinance.getHistorical('JNJ', '2016-08-01', '2016-08-05', function (data) { | ||
yfinance.getHistorical('JNJ', '2016-08-01', '2016-08-05', function (err, data) { | ||
if(err) console.log(err); | ||
//... | ||
}); | ||
yfinance.getDividendHistory('JNJ', '2015-01-01', '2015-12-31', function (data) { | ||
yfinance.getDividendHistory('JNJ', '2015-01-01', '2015-12-31', function (err, data) { | ||
if(err) console.log(err); | ||
//... endDate not working! | ||
@@ -26,0 +29,0 @@ }); |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
6398
63
43