stock-bars
v0.2.0
Published
Get stock bars from Yahoo Finance.
Downloads
4
Readme
Stock bars
Get stock bars from Yahoo Finance.
Setup
This library use curl to download stock data, please make sure that the curl
command is available in your system.
Usage
import Stock from 'stock-bars';
const stock = new Stock('SPY');
const main = async () => {
await stock.fetch('1d'); // 1d for daily, 1wk for weekly, 1mo for monthly
// stock.history contains all the bars
};
main();
Auto cache
By default, stock data will be downloaded and saved in .stock-cache
folder.
If you don't want stock data to be read from cache folder, clear or delete the folder.