Realtime Stock
Grabs information about a stock from Yahoo! Finance.
Full support for async/await.
Installation
via npm:
npm i realtime-stock --save
via git:
git clone https://github.com/marchsabino/realtime-stock
Usage
// var Stock = require("realtime-stock").Stock;; // Logs information on Facebook's stock to the console.; // #=> Promise<any> facebook .thenconsole.logdata .catchconsole.logerr;
Example Output:
sourceInterval: 15 quoteSourceName: 'Nasdaq Real Time Price' regularMarketOpen: raw: 1799 fmt: '179.9000' exchange: 'NMS' regularMarketTime: raw: 1519415510 fmt: '2:51PM EST' sharesOutstanding: raw: 2395919872 fmt: '2.396B' longFmt: '2,395,919,872' regularMarketDayHigh: raw: 18279 fmt: '182.7900' shortName: 'Facebook, Inc.' longName: 'Facebook, Inc.' exchangeTimezoneName: 'America/New_York' regularMarketChange: raw: 37610931 fmt: '3.7611' regularMarketPreviousClose: raw: 17899 fmt: '178.9900' fiftyTwoWeekHighChange: raw: -12568909 fmt: '-12.57' exchangeTimezoneShortName: 'EST' fiftyTwoWeekLowChange: raw: 48591095 fmt: '48.59' exchangeDataDelayedBy: 0 regularMarketDayLow: raw: 17951 fmt: '179.5100' priceHint: 4 currency: 'USD' regularMarketPrice: raw: 1827511 fmt: '182.7511' regularMarketVolume: raw: 13285963 fmt: '13.286M' longFmt: '13,285,963' isLoading: false gmtOffSetMilliseconds: -18000000 marketState: 'REGULAR' marketCap: raw: 530891931648 fmt: '530.892B' longFmt: '530,891,931,648' quoteType: 'EQUITY' invalid: false symbol: 'FB' language: 'en-US' fiftyTwoWeekLowChangePercent: raw: 036218765 fmt: '36.22%' messageBoardId: 'finmb_20765463' fiftyTwoWeekHigh: raw: 19532 fmt: '195.3200' fiftyTwoWeekHighChangePercent: raw: -006435034 fmt: '-6.44%' uuid: '30781f1f-c2f9-342c-ab1a-d2f6f35a51db' market: 'us_market' fiftyTwoWeekLow: raw: 13416 fmt: '134.1600' regularMarketChangePercent: raw: 21012866 fmt: '2.1013%' fullExchangeName: 'NasdaqGS' tradeable: true
License
Copyright © 2018 Marcello Sabino (marchsabino@gmail.com) and released under the MIT License.