@zero65tech/indian-stock-market v4.3.1
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-marketUsage
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 falsehasOpened()
Checks if the market has opened today.
const opened = ism.hasOpened();
console.log(opened); // true or falsehasClosed()
Checks if the market has closed today.
const closed = ism.hasClosed();
console.log(closed); // true or falseisHoliday(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 falseconst holiday = ism.isHoliday('2021-10-02');
console.log(holiday); // true or falseconst holiday = ism.isHoliday(new Date('2021-10-02'));
console.log(holiday); // true or falseLicense
This project is licensed under the MIT License.
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago