4.3.1 • Published 5 months ago

@zero65tech/indian-stock-market v4.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Indian Stock Market

This npm package provides utilities to work with the Indian stock market, including functions to determine market holidays, expiry dates for futures and options, and market open/close status.

Installation

npm install @zero65tech/indian-stock-market

Usage

Importing the package

const ism = require('@zero65tech/indian-stock-market');

Functions

fo(name)

Returns information about the futures or options contract.

const info = ism.fo('NIFTY21OCTFUT');
console.log(info);
// { symbol: 'NIFTY', exp: '21OCT', expiry: '2021-10-28', type: 'FUT' }

isOpen()

Checks if the market is currently open.

const open = ism.isOpen();
console.log(open); // true or false

hasOpened()

Checks if the market has opened today.

const opened = ism.hasOpened();
console.log(opened); // true or false

hasClosed()

Checks if the market has closed today.

const closed = ism.hasClosed();
console.log(closed); // true or false

isHoliday(date)

Checks if the given date is a market holiday. If no date is provided, it checks for today.

const holiday = ism.isHoliday();
console.log(holiday); // true or false
const holiday = ism.isHoliday('2021-10-02');
console.log(holiday); // true or false
const holiday = ism.isHoliday(new Date('2021-10-02'));
console.log(holiday); // true or false

License

This project is licensed under the MIT License.

4.3.1

5 months ago

4.2.3

6 months ago

4.3.0

5 months ago

4.2.2

6 months ago

4.2.1

6 months ago

4.2.0

6 months ago

4.1.14

6 months ago

4.1.11

7 months ago

4.1.12

7 months ago

4.1.13

7 months ago

4.1.8

11 months ago

4.1.9

11 months ago

4.1.10

11 months ago

4.1.7

1 year ago

4.1.6

1 year ago

4.1.5

1 year ago

4.1.4

1 year ago

4.1.3

1 year ago

4.1.2

2 years ago

4.1.1

2 years ago

4.1.0

2 years ago

4.0.2

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.4

2 years ago