← All packages

@lacspace/market-clock

v1.0.6StockKit0 deps

Holiday-aware, timezone-correct trading clock — is NSE/BSE open now, next open/close, pre-open, holidays. Bring your own exchange spec. Zero-dependency.

npm i @lacspace/market-clock

Usage

market-clock.ts
import { MarketClock, NSE } from "@lacspace/market-clock";

const nse = new MarketClock(NSE);

nse.isOpen();        // true / false, right now (IST-correct from any timezone)
nse.status();        // "open" | "pre-open" | "closed"
nse.isHoliday();     // is today an exchange holiday?

nse.nextOpen();      // Date — next session open
nse.nextClose();     // Date — next session close
nse.msToClose();     // ms remaining until close (0 if not open)

Exports 4

BSEMarketClockNSEcreateClock

Keywords

market-hourstrading-hoursstock-marketnsebsemarket-open

More in StockKit