{"id":13485106,"url":"https://github.com/js-temporal/temporal-polyfill","last_synced_at":"2026-01-11T17:40:37.916Z","repository":{"id":38328831,"uuid":"365035326","full_name":"js-temporal/temporal-polyfill","owner":"js-temporal","description":"Polyfill for Temporal (under construction)","archived":false,"fork":false,"pushed_at":"2024-05-08T08:30:20.000Z","size":3869,"stargazers_count":489,"open_issues_count":44,"forks_count":27,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-05-17T11:02:10.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/js-temporal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-06T20:56:01.000Z","updated_at":"2024-06-03T23:33:24.752Z","dependencies_parsed_at":"2024-01-13T22:23:10.507Z","dependency_job_id":"24c7888a-0aad-4c53-a79b-883c2773beac","html_url":"https://github.com/js-temporal/temporal-polyfill","commit_stats":{"total_commits":1271,"total_committers":47,"mean_commits":27.04255319148936,"dds":0.4878048780487805,"last_synced_commit":"97637bbc3d7d1546ea67586534efc87b84c12359"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-temporal%2Ftemporal-polyfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-temporal%2Ftemporal-polyfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-temporal%2Ftemporal-polyfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-temporal%2Ftemporal-polyfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js-temporal","download_url":"https://codeload.github.com/js-temporal/temporal-polyfill/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240117371,"owners_count":19750345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:46.149Z","updated_at":"2026-01-11T17:40:37.911Z","avatar_url":"https://github.com/js-temporal.png","language":"TypeScript","readme":"# Temporal Polyfill\n\n## Polyfill for [TC39 Proposal: Temporal](https://github.com/tc39/proposal-temporal)\n\nThis polyfill was kicked off by some of the champions of the [Temporal proposal](https://github.com/tc39/proposal-temporal).\nThe goal is to be ready for production use when the Temporal proposal reaches Stage 4, although like with all OSS work progress is dependent on contributors.\nWe're eagerly welcoming to contributors who want to help build and maintain this polyfill.\nPRs are always welcome!\n\nNote that this polyfill is not affiliated with TC39. Links to other polyfills can be found [here](https://github.com/tc39/proposal-temporal/tree/main/#polyfills).\n\nThis polyfill is compatible with Node.js 14 or later.\n\n## v0.4.0 =\u003e v0.5.0 Breaking Changes and Migration\n\nUntil recently, this polyfill lagged behind the proposal repo (and its not-for-production-use polyfill).\nIt's now caught up with the last few years of changes to the Temporal proposal, including many removed APIs and other breaking changes.\nWhile breaking changes to any TC39 proposal are always possible before [Stage 4](https://tc39.es/process-document/), Temporal is close to adoption and no significant changes are expected in the future.\n\nThe [changelog](./CHANGELOG.md#050) details what's changed, including tips for migrating existing code to the latest version.\n\n## Roadmap\n\n- [x] Fork non-production polyfill from [tc39/proposal-temporal repo](https://github.com/tc39/proposal-temporal/tree/main/polyfill)\n- [x] Release initial pre-alpha to NPM at [@js-temporal/polyfill](https://www.npmjs.com/package/@js-temporal/polyfill)\n- [x] Sync the code in this repo with the handful of polyfill changes that have recently been made in the [tc39/proposal-temporal](https://github.com/tc39/proposal-temporal) repo\n- [x] Release alpha version to NPM\n- [x] Deprecate all other earlier Temporal polyfills\n- [x] Optimize slow operations by reducing calls to Intl.DateTimeFormat constructor (see [#7](https://github.com/js-temporal/temporal-polyfill/issues/7), [#8](https://github.com/js-temporal/temporal-polyfill/pull/8), [#10](https://github.com/js-temporal/temporal-polyfill/pull/10), [#12](https://github.com/js-temporal/temporal-polyfill/pull/12))\n- [x] Convert to TypeScript for better maintainability\n- [x] Improve typing of sources for better maintainability\n- [x] Migrate to JSBI for improved compile-time safety around BigInt operations.\n- [ ] Optimize performance of other slow operations\n- [ ] Release production version to NPM\n\n## Bug Reports and Feedback\n\nIf you think you've found a bug in the Temporal API itself (not the implementation in this polyfill), please file an issue in the [tc39/proposal-temporal issue tracker](https://github.com/tc39/proposal-temporal/issues).\n\nIf you've found a bug in this polyfill\u0026mdash;meaning that the implementation here doesn't match the [Temporal spec](https://tc39.es/proposal-temporal/)\u0026mdash;please file an issue in this repo's [issue tracker](https://github.com/js-temporal/temporal-polyfill/issues).\n\n## Documentation\n\nReference documentation and examples for the Temporal API can be found [here](https://tc39.es/proposal-temporal/docs/index.html).\n\nA cookbook to help you get started and learn the ins and outs of Temporal is available [here](https://tc39.es/proposal-temporal/docs/index.html)\n\nIf you find a bug in the documentation, please file a bug over in the [tc39/proposal-temporal issue tracker](https://github.com/tc39/proposal-temporal/issues) issue tracker.\n\nNote that the Temporal documentation is in the process of being migrated to [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript).\nYou can track the progress of the MDN migration [here](https://github.com/tc39/proposal-temporal/issues/1449).\n\n## Usage\n\nTo install:\n\n```bash\n$ npm install @js-temporal/polyfill\n```\n\nCJS Usage:\n\n```javascript\nconst { Temporal, Intl, toTemporalInstant } = require('@js-temporal/polyfill');\nDate.prototype.toTemporalInstant = toTemporalInstant;\n```\n\nImport the polyfill as an ES6 module:\n\n```javascript\nimport { Temporal, Intl, toTemporalInstant } from '@js-temporal/polyfill';\nDate.prototype.toTemporalInstant = toTemporalInstant;\n```\n\nNote that this polyfill currently does not install a global `Temporal` object like a real implementation will.\nThis behavior avoids hiding the global Temporal object in environments where a real Temporal implementation is present.\nSee [this issue](https://github.com/tc39/proposal-temporal/issues/778) for more background on this decision.\nOnce JS engines start shipping with Temporal, we may decide to change this behavior to match built-in behavior more closely.\nSee [#2](https://github.com/js-temporal/temporal-polyfill/issues/2) to provide feedback or track this issue.\n\nThis polyfill ships ES2020 code for both CJS and ESM bundles - if your\nenvironment does not support ES2020, then please make sure to transpile the\ncontent of this package along with the rest of your code.\n\nThis polyfill uses [JSBI](https://github.com/GoogleChromeLabs/jsbi) to enable backwards-compatibility for environments that don't support native bigints. If your project only ever runs in environments that do support native bigints (see [caniuse data](https://caniuse.com/bigint)), we highly recommend configuring the [JSBI Babel plugin](https://github.com/GoogleChromeLabs/babel-plugin-transform-jsbi-to-bigint) that translates JSBI calls to their native bigint equivalent, improving code-size and performance. We are exploring ways to provide separate builds for these use-cases in [#155](https://github.com/js-temporal/temporal-polyfill/issues/155).\n\n## Contributing / Help Wanted\n\nWe're eagerly welcoming to contributors who want to help build and maintain this polyfill.\nPRs are always welcome!\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-temporal%2Ftemporal-polyfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs-temporal%2Ftemporal-polyfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-temporal%2Ftemporal-polyfill/lists"}