Comparing version 0.0.0 to 0.0.1
@@ -1,7 +0,60 @@ | ||
"use strict"; | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports["default"] = {}; | ||
module.exports = exports["default"]; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _request = require('request'); | ||
var _request2 = _interopRequireDefault(_request); | ||
var Gfinance = (function () { | ||
function Gfinance() { | ||
_classCallCheck(this, Gfinance); | ||
this.get = this.get.bind(this); | ||
this._apiEndpoint = 'https://finance.google.com/finance/info'; | ||
} | ||
_createClass(Gfinance, [{ | ||
key: 'get', | ||
value: function get(tickerList, callback) { | ||
var _this = this; | ||
if (tickerList === undefined) tickerList = []; | ||
if (!tickerList.length) { | ||
return callback('No Stock tickers were passed'); | ||
} | ||
var query = this._apiEndpoint + '?client=ig&q=' + tickerList.join(','); | ||
(0, _request2['default'])(query, function (error, response, body) { | ||
if (error) { | ||
return callback(error); | ||
} else if (parseInt(response.statusCode, 10) !== 200) { | ||
return callback('Google Finance Returned: ' + response.statusCode); | ||
} | ||
body = _this._onParse(body); | ||
callback(error, body); | ||
}); | ||
} | ||
}, { | ||
key: '_onParse', | ||
value: function _onParse(data) { | ||
data = data.substr(4); | ||
return JSON.parse(data); | ||
} | ||
}]); | ||
return Gfinance; | ||
})(); | ||
exports['default'] = new Gfinance(); | ||
module.exports = exports['default']; |
{ | ||
"name": "gfinance", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "A way to access the now deprecated Google Finance API", | ||
@@ -26,6 +26,10 @@ "homepage": "https://github.com/zenware/gfinance", | ||
"devDependencies": { | ||
"babel-core": "^5.5.0", | ||
"babel-eslint": "^4.1.6", | ||
"del": "^2.0.2", | ||
"eslint-config-xo-space": "^0.7.0", | ||
"babel-eslint": "^4.1.6", | ||
"eslint-plugin-babel": "^3.0.0", | ||
"gulp": "^3.9.0", | ||
"gulp-babel": "^5.1.0", | ||
"gulp-coveralls": "^0.1.0", | ||
"gulp-eslint": "^1.0.0", | ||
@@ -35,9 +39,7 @@ "gulp-exclude-gitignore": "^1.0.0", | ||
"gulp-mocha": "^2.0.0", | ||
"gulp-nsp": "^2.1.0", | ||
"gulp-plumber": "^1.0.0", | ||
"gulp-nsp": "^2.1.0", | ||
"gulp-coveralls": "^0.1.0", | ||
"gulp-babel": "^5.1.0", | ||
"del": "^2.0.2", | ||
"babel-core": "^5.5.0", | ||
"isparta": "^3.0.3" | ||
"isparta": "^3.0.3", | ||
"mocha-sinon": "^1.1.5", | ||
"sinon": "^1.17.3" | ||
}, | ||
@@ -55,3 +57,6 @@ "eslintConfig": { | ||
}, | ||
"license": "MIT" | ||
"license": "MIT", | ||
"dependencies": { | ||
"request": "^2.69.0" | ||
} | ||
} |
@@ -28,3 +28,3 @@ # gfinance [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url] | ||
[daviddm-url]: https://david-dm.org/zenware/gfinance | ||
[coveralls-image]: https://coveralls.io/repos/zenware/gfinance/badge.svg | ||
[coveralls-url]: https://coveralls.io/r/zenware/gfinance | ||
[coveralls-image]: https://coveralls.io/repos/zenware/gfinance/badge.svg?branch=master | ||
[coveralls-url]: https://coveralls.io/r/zenware/gfinance?branch=master |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
5641
45
0
1
17
+ Addedrequest@^2.69.0
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)