Package Installation
Install Atemporal using your preferred package manager:Requirements
Node.js 18 or higher is required to use Atemporal. The library uses the Temporal API polyfill which requires modern JavaScript features.
@js-temporal/polyfill- Provides Temporal API support until native implementation is available in all environments
Browser Support
Atemporal works in all modern browsers that support ES2020. The Temporal polyfill is automatically used until native Temporal support is available (expected in 2026).- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Node.js 18+
TypeScript Setup
Atemporal is built with TypeScript and includes full type definitions out of the box. No additional@types packages are needed.
Basic Configuration
Ensure yourtsconfig.json includes these settings:
tsconfig.json
Type Imports
Atemporal exports TypeScript types for all its public APIs:Verify Installation
Create a simple test file to verify everything is working:Module Systems
Atemporal supports both ES Modules and CommonJS:- ES Modules (Recommended)
- CommonJS
Bundle Size
Atemporal is designed to be lightweight:- Core library: ~15KB (minified + gzipped)
- Temporal polyfill: ~50KB (minified + gzipped)
- Each plugin: 1-3KB (minified + gzipped)
When native Temporal support lands in browsers (expected 2026), the polyfill will no longer be needed, reducing the total bundle size significantly.
Installing Plugins
Plugins are included in the main package and can be imported from subpaths:Troubleshooting
Error: Cannot find module 'atemporal'
Error: Cannot find module 'atemporal'
Make sure you’ve installed the package:If using TypeScript, ensure
moduleResolution is set to "node" in your tsconfig.json.Error: Temporal is not defined
Error: Temporal is not defined
This usually means your Node.js version is too old. Atemporal requires Node.js 18 or higher.Check your version:Upgrade if necessary:
TypeScript errors with Temporal types
TypeScript errors with Temporal types
The Temporal API types come from
@js-temporal/polyfill. Make sure your tsconfig.json includes:Plugin imports not working
Plugin imports not working
Make sure you’re using the correct import path:For CommonJS, always access the
.default export:Next Steps
Quick Start Guide
Learn the basics and build your first date-time feature with Atemporal