marcal
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Stock Market Calendar

MarCal is a TypeScript library that provides a stock market calendar for stock trading applications. For now, it provides the calendar for the years 2023, 2024 and 2025.

Note that all the U.S. stock exchanges open at the same time. The three major stock exchanges NYSE, NASDAQ, and the American Stock Exchange synchronize opening times.

Install

npm i marcal

Usage

import { MarCal, MarCalType } from 'marcal';

const marCal: MarCalType = new MarCal();

const open: boolean = marCal.isMarketOpen();
if (open) {
  console.log('US market is open')
} else {
  console.log('US market is closed')
}

Methods

// Returns true if US market is open. Otherwise, false.
isMarketOpen(): boolean

// Returns the number of remaining minutes before the market closes.
minutesToClose(): number

Contributions

Contributions are welcome and can be made by submitting GitHub pull requests to this repository. In general, the MarCal source code follows Airbnb JavaScript Style Guide and the rules specified in .eslintrc.json file.

License

This source code is available to everyone under the standard MIT LICENSE.

Package Sidebar

Install

npm i marcal

Weekly Downloads

8

Version

0.3.0

License

MIT

Unpacked Size

15 kB

Total Files

15

Last publish

Collaborators

  • baloian