Install the core package from npm:
chevron_leftchevron_right
pnpm add @timestamp-js/coreThe package is ESM, side-effect free, and designed for tree-shaking. Prefer named imports so bundlers can keep only the helpers your app actually uses.
import { parseTimestamp, today, type Timestamp } from '@timestamp-js/core'
const model = today()
const timestamp: Timestamp | null = parseTimestamp(model)Runtime support
Timestamp targets modern JavaScript runtimes. It uses standard APIs such as Date and Intl.DateTimeFormat, and it avoids browser-only globals.
That makes it suitable for:
- Browser applications
- Node.js applications
- Server-rendered applications
- Static-site generation
- Serverless and edge-style runtimes that provide
DateandIntl
TypeScript
Types are shipped with the package and are available from the main export:
import type { Timestamp, TimeObject, DisabledDay } from '@timestamp-js/core'