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

alphavantage

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alphavantage - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

4

CHANGELOG.md

@@ -40,1 +40,5 @@ 0.0.1

adjusted
1.1.0
- Adding batch quote support
- Updating jest to 22.0.4

@@ -32,4 +32,12 @@ 'use strict';

monthly: series('TIME_SERIES_MONTHLY'),
monthly_adjusted: series('TIME_SERIES_MONTHLY_ADJUSTED')
monthly_adjusted: series('TIME_SERIES_MONTHLY_ADJUSTED'),
batch: symbols => {
// Convert array to csv string.
if (symbols instanceof Array) {
symbols = symbols.join(',');
}
return util.fn('BATCH_STOCK_QUOTES')({ symbols });
}
};
};

@@ -65,2 +65,3 @@ 'use strict';

'Monthly Time Series': 'data',
'Stock Quotes': 'data',
'Technical Analysis: SMA': 'data',

@@ -124,2 +125,3 @@ 'Technical Analysis: EMA': 'data',

'1b. open (USD)': 'usd_open',
'2. price': 'price',
'2. high': 'high',

@@ -137,2 +139,3 @@ '2. From_Currency Name': 'from_currency_name',

'3. market cap (USD)': 'cap',
'3. volume': 'volume',
'3b. low (USD)': 'usd_low',

@@ -145,2 +148,3 @@ '4. Output Size': 'size',

'4. Time Zone': 'zone',
'4. timestamp': 'updated',
'4b. close (USD)': 'usd_close',

@@ -147,0 +151,0 @@ '5. adjusted close': 'adjusted',

4

package.json
{
"name": "alphavantage",
"version": "1.0.0",
"version": "1.1.0",
"description": "A simple interface to the Alpha Vantage API.",

@@ -40,3 +40,3 @@ "main": "index.js",

"delay": "^2.0.0",
"jest": "^21.2.1",
"jest": "^22.0.4",
"prettier": "^1.7.4"

@@ -43,0 +43,0 @@ },

@@ -34,2 +34,6 @@ # AlphaVantage

alpha.data.batch([`msft`, `aapl`]).then(data => {
console.log(data);
});
alpha.forex.rate('btc', 'usd').then(data => {

@@ -72,2 +76,3 @@ console.log(data);

alpha.data.monthly_adjusted(symbol, interval)
alpha.data.batch([symbol1, symbol2..])
```

@@ -74,0 +79,0 @@

@@ -79,1 +79,34 @@ 'use strict';

test(`batch data works`, () => {
expect.assertions(9);
return delay(TIME)
.then(() => alpha.data.batch('MSFT,FB,AAPL'))
.then(data => {
expect(data['Meta Data']).toBeDefined();
expect(data['Stock Quotes']).toBeDefined();
expect(data['Stock Quotes'].length).toEqual(3);
data['Stock Quotes'].forEach(quote => {
expect(quote['1. symbol']).toBeDefined();
});
expect(data['Stock Quotes'][0]['1. symbol']).toEqual('MSFT');
expect(data['Stock Quotes'][1]['1. symbol']).toEqual('FB');
expect(data['Stock Quotes'][2]['1. symbol']).toEqual('AAPL');
});
});
test(`batch data works with array input`, () => {
expect.assertions(9);
return delay(TIME)
.then(() => alpha.data.batch(['MSFT', 'FB', 'AAPL']))
.then(data => {
expect(data['Meta Data']).toBeDefined();
expect(data['Stock Quotes']).toBeDefined();
expect(data['Stock Quotes'].length).toEqual(3);
data['Stock Quotes'].forEach(quote => {
expect(quote['1. symbol']).toBeDefined();
});
expect(data['Stock Quotes'][0]['1. symbol']).toEqual('MSFT');
expect(data['Stock Quotes'][1]['1. symbol']).toEqual('FB');
expect(data['Stock Quotes'][2]['1. symbol']).toEqual('AAPL');
});
});
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