Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-finance-service

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-finance-service - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

.travis.yml

9

lib/google-finance-service.js
var $ = require('jquery');
module.exports = function (symbols, exchange) {
module.exports = function (symbols, success, error) {
if (Array.isArray(symbols)) {

@@ -14,5 +14,8 @@ symbols = symbols.join();

dataType: "jsonp",
cache: true
cache: true,
success: success,
error: error
};
return $.ajax(options);
$.ajax(options);
return this;
};
{
"name": "google-finance-service",
"version": "0.0.0",
"description": "",
"version": "0.0.1",
"description": "Simple browser-friendly micro service for the google finance api",
"keywords": ["browser", "client", "google", "finance", "micro-service"],
"main": "index.js",

@@ -24,3 +25,3 @@ "directories": {

"author": "tomkp",
"license": "BSD-2-Clause",
"license": "MIT",
"bugs": {

@@ -27,0 +28,0 @@ "url": "https://github.com/tomkp/google-finance-service/issues"

#Examples
# google-finance-service
## Symbols as an Array
Simple browser-friendly micro service for the google finance api
[![Build Status](https://travis-ci.org/tomkp/google-finance-service.png)](https://travis-ci.org/tomkp/google-finance-service)
### Symbols as an Array
```
var service = require('google-finance-service');
$.when(
service(['LON:TSCO', 'LON:RDSA'])
).then(
function (data) {}
);
service(['LON:TSCO', 'LON:RDSA'], function (data) { /* success */ }, function (data) { /* error */ });
```
## Symbols as a String
### Symbols as a String
```
var service = require('google-finance-service');
$.when(
service('LON:TSCO,LON:RDSA')
).then(
function (data) {}
);
```
service('LON:TSCO,LON:RDSA', function (data) { /* success */ }, function (data) { /* error */ });
```

@@ -8,15 +8,12 @@ var assert = require('assert');

it('fetches for comma separated list of symbols', function (done) {
$.when(
service('LON:TSCO,NASDAQ:GOOG')
).then(
function (data) {
console.info('success', data);
assert.equal(2, data.length);
assert.equal('Tesco PLC', data[0].name);
assert.equal('TSCO', data[0].t);
assert.equal('Google Inc', data[1].name);
assert.equal('GOOG', data[1].t);
done();
}
);
service('LON:TSCO,NASDAQ:GOOG', function (data) {
console.info('success', data);
assert.equal(2, data.length);
assert.equal('Tesco PLC', data[0].name);
assert.equal('TSCO', data[0].t);
assert.equal('Google Inc', data[1].name);
assert.equal('GOOG', data[1].t);
done();
});
});

@@ -26,15 +23,12 @@

it('fetches for array of symbols', function (done) {
$.when(
service(['LON:TSCO', 'NASDAQ:GOOG'])
).then(
function (data) {
console.info('success', data);
assert.equal(2, data.length);
assert.equal('Tesco PLC', data[0].name);
assert.equal('TSCO', data[0].t);
assert.equal('Google Inc', data[1].name);
assert.equal('GOOG', data[1].t);
done();
}
);
service(['LON:TSCO', 'NASDAQ:GOOG'], function (data) {
console.info('success', data);
assert.equal(2, data.length);
assert.equal('Tesco PLC', data[0].name);
assert.equal('TSCO', data[0].t);
assert.equal('Google Inc', data[1].name);
assert.equal('GOOG', data[1].t);
done();
});
});

@@ -41,0 +35,0 @@

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