New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gfinance

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gfinance - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

61

dist/index.js

@@ -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'];

23

package.json
{
"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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc