1.1.0 • Published 6 years ago

@marchsabino/stock.js v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

Stock.js

Grabs information about a stock from Yahoo! Finance.

Installation

  • Via npm - npm install @marchsabino/stock.js

Basic Usage:

const Stock = require('@marchsabino/stock.js');

let facebook = new Stock('fb');

facebook.data()
  .then((data) => console.log(data))
  .catch((err) => console.log(err));

Example Output:

{ sourceInterval: 15,
  quoteSourceName: 'Nasdaq Real Time Price',
  regularMarketOpen: { raw: 179.9, 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: 182.79, fmt: '182.7900' },
  shortName: 'Facebook, Inc.',
  longName: 'Facebook, Inc.',
  exchangeTimezoneName: 'America/New_York',
  regularMarketChange: { raw: 3.7610931, fmt: '3.7611' },
  regularMarketPreviousClose: { raw: 178.99, fmt: '178.9900' },
  fiftyTwoWeekHighChange: { raw: -12.568909, fmt: '-12.57' },
  exchangeTimezoneShortName: 'EST',
  fiftyTwoWeekLowChange: { raw: 48.591095, fmt: '48.59' },
  exchangeDataDelayedBy: 0,
  regularMarketDayLow: { raw: 179.51, fmt: '179.5100' },
  priceHint: 4,
  currency: 'USD',
  regularMarketPrice: { raw: 182.7511, 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: 0.36218765, fmt: '36.22%' },
  messageBoardId: 'finmb_20765463',
  fiftyTwoWeekHigh: { raw: 195.32, fmt: '195.3200' },
  fiftyTwoWeekHighChangePercent: { raw: -0.06435034, fmt: '-6.44%' },
  uuid: '30781f1f-c2f9-342c-ab1a-d2f6f35a51db',
  market: 'us_market',
  fiftyTwoWeekLow: { raw: 134.16, fmt: '134.1600' },
  regularMarketChangePercent: { raw: 2.1012866, fmt: '2.1013%' },
  fullExchangeName: 'NasdaqGS',
  tradeable: true }

License

Copyright © 2018 Marcello Sabino (marchsabino@gmail.com) and released under the MIT License.