alphavantage
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -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', |
{ | ||
"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'); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
122074
2533
168
0