{"_id":"@agape/temporal","_rev":"5-90d6ac3265061e6cf139cab497ff0f73","name":"@agape/temporal","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.0":{"name":"@agape/temporal","version":"0.1.0","keywords":["agape","temporal","date","time","polyfill"],"author":{"name":"Maverik Minett","email":"maverik.minett@gmail.com"},"license":"MIT","_id":"@agape/temporal@0.1.0","maintainers":[{"name":"maverik.minett","email":"maverik.minett@gmail.com"}],"homepage":"https://agape.dev","bugs":{"url":"https://github.com/AgapeToolkit/AgapeToolkit/issues"},"dist":{"shasum":"ba9df8ab442b9a10eeade0e39986e830b092249e","tarball":"https://registry.npmjs.org/@agape/temporal/-/temporal-0.1.0.tgz","fileCount":8,"integrity":"sha512-54aRtVr5LOQDezk4IjppcFs8sIv+bNo+P/3w0NmxL7aiDcOT7wbcjfcsNuRNmgKSoDDsJEw27I7XOAhSwApfNQ==","signatures":[{"sig":"MEUCIHn1CzE/u70FpOZ7H2D3NHiexPK1iJokjCHGDLD6Ay85AiEAslj27i8414AZMKjnMhyP3OqskzKS8NS/NuMUsOzfOjo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15648},"main":"./cjs/index.js","types":"./cjs/index.d.ts","es2020":"./es2020/index.js","module":"./es2020/index.js","exports":{".":{"node":"./cjs/index.js","es2020":"./es2020/index.js","import":"./es2020/index.js","default":"./es2020/index.js","require":"./cjs/index.js"},"./package.json":{"default":"./package.json"}},"gitHead":"5784cb315825fbeb2acb36d1da5bb72e7755a99d","_npmUser":{"name":"maverik.minett","email":"maverik.minett@gmail.com"},"repository":{"url":"git+https://github.com/AgapeToolkit/AgapeToolkit.git","type":"git"},"_npmVersion":"11.6.0","description":"Typed, dependency-free access to Temporal with fallback stub","directories":{},"_nodeVersion":"24.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/temporal_0.1.0_1758339098023_0.908165573547784","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@agape/temporal","version":"0.2.0","keywords":["agape","temporal","date","time","polyfill"],"author":{"name":"Maverik Minett","email":"maverik.minett@gmail.com"},"license":"MIT","_id":"@agape/temporal@0.2.0","maintainers":[{"name":"maverik.minett","email":"maverik.minett@gmail.com"}],"homepage":"https://agape.dev","bugs":{"url":"https://github.com/AgapeToolkit/AgapeToolkit/issues"},"dist":{"shasum":"901707d5eaadb69806af8e11a8af7deb5d3c056e","tarball":"https://registry.npmjs.org/@agape/temporal/-/temporal-0.2.0.tgz","fileCount":8,"integrity":"sha512-9YK8ctlJH+o2X0caJjXOM2e1msZzXghKJ0UXaFN1PdNTAE8lRZ371HpeF0Zz4VT0IthQJzKfE1HWDWFBjhmnRg==","signatures":[{"sig":"MEQCIBpnLL0lNfUyflIlJcwFKfTMioUP4mFzB4QxROYmB5VHAiBjF5c8iIcWBUJkiCwRyT30PO8tS5lET+2GQPBYS7QunA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51323},"main":"./cjs/index.js","types":"./cjs/index.d.ts","es2020":"./es2020/index.js","module":"./es2020/index.js","exports":{".":{"node":"./cjs/index.js","es2020":"./es2020/index.js","import":"./es2020/index.js","default":"./es2020/index.js","require":"./cjs/index.js"},"./package.json":{"default":"./package.json"}},"gitHead":"4ec0f6b23467bb83a3282fefafeaadb9b2f7ce71","_npmUser":{"name":"maverik.minett","email":"maverik.minett@gmail.com"},"repository":{"url":"git+https://github.com/AgapeToolkit/AgapeToolkit.git","type":"git"},"_npmVersion":"11.6.0","description":"Temporal namespace","directories":{},"_nodeVersion":"24.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/temporal_0.2.0_1758844966779_0.04682517178579859","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@agape/temporal","version":"0.3.0","keywords":["agape","temporal","date","time","polyfill"],"author":{"name":"Maverik Minett","email":"maverik.minett@gmail.com"},"license":"MIT","_id":"@agape/temporal@0.3.0","maintainers":[{"name":"maverik.minett","email":"maverik.minett@gmail.com"}],"homepage":"https://agape.dev","bugs":{"url":"https://github.com/AgapeToolkit/AgapeToolkit/issues"},"dist":{"shasum":"c3b7ff3062e7e02921fcb2dade48e8250e0226c6","tarball":"https://registry.npmjs.org/@agape/temporal/-/temporal-0.3.0.tgz","fileCount":20,"integrity":"sha512-HH+jBnbkDrqhFIMHZlnrHpZGH5KEhbAnHCp3wF+UkB00ZfY8n0PeblIkfbVS/dMtHHBq4aH2lRmpli1FAHXrUA==","signatures":[{"sig":"MEUCIF12C7exZ2pvQsx4UME6U4v0LH7+OifnRX/fmO7FrIAXAiEAlq4Fs+ARhOxUKrFtJBsI44ct4hadIiki3cgaF1HElW8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54436},"main":"./cjs/index.js","types":"./cjs/index.d.ts","es2020":"./es2020/index.js","module":"./es2020/index.js","exports":{".":{"node":"./cjs/index.js","es2020":"./es2020/index.js","import":"./es2020/index.js","default":"./es2020/index.js","require":"./cjs/index.js"},"./package.json":{"default":"./package.json"}},"gitHead":"af63a7d66f5df74c1588f2fbe9864b9508a50833","_npmUser":{"name":"maverik.minett","email":"maverik.minett@gmail.com"},"repository":{"url":"git+https://github.com/AgapeToolkit/AgapeToolkit.git","type":"git"},"_npmVersion":"11.6.0","description":"Temporal namespace","directories":{},"_nodeVersion":"24.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/temporal_0.3.0_1758854418811_0.588059374897639","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@agape/temporal","version":"0.3.1","keywords":["agape","temporal","date","time","polyfill"],"author":{"name":"Maverik Minett","email":"maverik.minett@gmail.com"},"license":"MIT","_id":"@agape/temporal@0.3.1","maintainers":[{"name":"maverik.minett","email":"maverik.minett@gmail.com"}],"homepage":"https://agape.dev","bugs":{"url":"https://github.com/AgapeToolkit/AgapeToolkit/issues"},"dist":{"shasum":"14a2cc56d3f18783014bd52279c9e698cd9858de","tarball":"https://registry.npmjs.org/@agape/temporal/-/temporal-0.3.1.tgz","fileCount":20,"integrity":"sha512-DxfBNvcdVCZLAu4HE2oXu0JOLDaJp454jzZDTt9tteMJ0JH1HyBVBtlwYyPju6RafF0KOKb5quotj+mxnPx87A==","signatures":[{"sig":"MEUCIQDyvykDxYoxCqig1oBjiPLhQvMxl1gduu3c2CcmrF5BugIgY3osX2N0wt/hQvocQ7Oz3kP4SS4AAIfTebYP02BXBxc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54739},"main":"./cjs/index.js","types":"./cjs/index.d.ts","es2020":"./es2020/index.js","module":"./es2020/index.js","exports":{".":{"node":"./cjs/index.js","es2020":"./es2020/index.js","import":"./es2020/index.js","default":"./es2020/index.js","require":"./cjs/index.js"},"./package.json":{"default":"./package.json"}},"gitHead":"c1289c7a4725569e2b9868894b2a65ce40d0d9b2","_npmUser":{"name":"maverik.minett","email":"maverik.minett@gmail.com"},"repository":{"url":"git+https://github.com/AgapeToolkit/AgapeToolkit.git","type":"git"},"_npmVersion":"11.6.0","description":"Temporal namespace","directories":{},"_nodeVersion":"24.9.0","dependencies":{"@js-temporal/polyfill":"^0.4.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/temporal_0.3.1_1758936858708_0.18344066552624572","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@agape/temporal","version":"0.3.2","description":"Temporal namespace","main":"./cjs/index.js","module":"./es2020/index.js","author":{"name":"Maverik Minett","email":"maverik.minett@gmail.com"},"license":"MIT","publishConfig":{"access":"public"},"homepage":"https://agape.dev","repository":{"type":"git","url":"git+https://github.com/AgapeToolkit/AgapeToolkit.git"},"dependencies":{"@js-temporal/polyfill":"^0.4.4"},"keywords":["agape","temporal","date","time","polyfill"],"es2020":"./es2020/index.js","exports":{"./package.json":{"default":"./package.json"},".":{"es2020":"./es2020/index.js","node":"./cjs/index.js","default":"./es2020/index.js","require":"./cjs/index.js","import":"./es2020/index.js"}},"_id":"@agape/temporal@0.3.2","gitHead":"ea7a8621a855d44de16b39b1dcfbb4849c109e00","types":"./cjs/index.d.ts","bugs":{"url":"https://github.com/AgapeToolkit/AgapeToolkit/issues"},"_nodeVersion":"24.9.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-aUNauZoYdKaw9qBiQ4HATar2UWFEYQLuEKwhe24RY/y38gTidZNwdtippiFd3L6KtrJqa++ejRzTfIlJ6WngjQ==","shasum":"c153cd4680c49150923e9bfe2c6bb44ac9c46d51","tarball":"https://registry.npmjs.org/@agape/temporal/-/temporal-0.3.2.tgz","fileCount":20,"unpackedSize":55951,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEXSL57xJPVU+UsKu7oKdtsbiXAIOcXNi0vim8/D97rXAiBc8+c10fGuDxI7/6Welfo+3IlX+xp3ueTqsPMy/yJU7A=="}]},"_npmUser":{"name":"maverik.minett","email":"maverik.minett@gmail.com"},"directories":{},"maintainers":[{"name":"maverik.minett","email":"maverik.minett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/temporal_0.3.2_1759055146219_0.8999066940677798"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-20T03:31:37.901Z","modified":"2025-09-28T10:25:46.670Z","0.1.0":"2025-09-20T03:31:38.193Z","0.2.0":"2025-09-26T00:02:46.991Z","0.3.0":"2025-09-26T02:40:18.975Z","0.3.1":"2025-09-27T01:34:18.895Z","0.3.2":"2025-09-28T10:25:46.427Z"},"bugs":{"url":"https://github.com/AgapeToolkit/AgapeToolkit/issues"},"author":{"name":"Maverik Minett","email":"maverik.minett@gmail.com"},"license":"MIT","homepage":"https://agape.dev","keywords":["agape","temporal","date","time","polyfill"],"repository":{"type":"git","url":"git+https://github.com/AgapeToolkit/AgapeToolkit.git"},"description":"Temporal namespace","maintainers":[{"name":"maverik.minett","email":"maverik.minett@gmail.com"}],"readme":"# @agape/temporal\n\nAccess the Temporal namespace safely, even in environments where it's not natively available.\n\n`@agape/temporal` is designed primarily for **library authors** who need to work with Temporal but can’t guarantee it’s installed in the consumer’s runtime. It provides a drop-in `Temporal` namespace that either uses the real implementation (native or polyfill) or falls back to stubs that throw clear runtime errors. This lets your library **safely reference Temporal types**, fail gracefully when it’s unavailable, and let consumers decide whether to install a polyfill.\n\nExample pattern for library authors:\n\n```typescript\nimport { Temporal, hasTemporal } from '@agape/temporal';\n\nexport function addHours(hours: number) {\n  if (!hasTemporal()) {\n    throw new Error('Temporal support required for addHours');\n  }\n\n  return Temporal.Now.plainDateTimeISO().add({ hours });\n}\n```\n\n## 🚀 Get Started\n\n```typescript\nimport { Temporal, hasTemporal, setTemporal } from '@agape/temporal';\n\n// Always works - checks for Temporal availability\nif (hasTemporal()) {\n  const now = Temporal.PlainDateTime.from('2025-09-19T10:00');\n  console.log(now.toString()); // \"2025-09-19T10:00:00\"\n} else {\n  console.log('Temporal not available, using fallback');\n}\n```\n\n### With Polyfill\n\nIf the native Temporal exists, or a polyfill has been set on the `globalThis`, that\nwill be the implementation used.\n\n```typescript\nimport { Temporal as TemporalPolyfill } from '@js-temporal/polyfill';\n(globalThis as any)['Temporal'] = TemporalPolyfill;\n\nimport { Temporal } from '@agape/temporal';\n\n// Temporal just works\nconst date = Temporal.PlainDate.from('2025-09-19');\nconst duration = Temporal.Duration.from('PT1H30M');\n```\n\n### With Agape Configuration\n\nYou can configure which implementation Agape uses.\n\n```typescript\nimport { Temporal as TemporalPolyfill } from '@js-temporal/polyfill';\nimport { setTemporal, Temporal } from '@agape/temporal';\n\nsetTemporal(TemporalPolyfill);\n\nconst date = Temporal.PlainDate.from('2025-09-19');\nconst duration = Temporal.Duration.from('PT1H30M');\n```\n\n## 📖 API\n\n### `Temporal` Namespace\nUse the full Temporal API — `Temporal.PlainDateTime`, `Temporal.PlainDate`, `Temporal.Duration`, etc. Works with real Temporal or provides helpful error stubs.\n\n### `hasTemporal(): boolean`\nCheck if Temporal is available before using it.\n\n### `setTemporal(temporal): void`\nConfigure your preferred Temporal implementation (polyfill, custom, etc.).\n\n## ⚠️ Error Handling\n\nWhen Temporal is not available, the library throws `TemporalNotAvailableError` with helpful guidance:\n\n```typescript\nimport { Temporal, TemporalNotAvailableError } from '@agape/temporal';\n\ntry {\n  const date = Temporal.PlainDate.from('2025-09-19');\n} catch (error) {\n  if (error instanceof TemporalNotAvailableError) {\n    console.error('Temporal not available:', error.message);\n    // Handle gracefully or use fallback\n  }\n}\n```\n\nThe error message includes guidance on resolving the issue:\n- Use a JavaScript runtime with native Temporal support\n- Install a polyfill like `@js-temporal/polyfill`\n\n---\n\n## 🔗 Dependency on `@js-temporal/polyfill`\n\nThis package lists `@js-temporal/polyfill` as a dependency so that its **type definitions** are always available at build time.\n\n- **No Runtime Code Included:** The polyfill’s runtime is **never imported or bundled** by `@agape/temporal`.\n- **Safe for Library Authors:** Your consumers remain free to install or omit a polyfill — you are not forcing one into their build.\n- **Tree-Shakable:** Modern bundlers will include nothing from `@js-temporal/polyfill` at runtime unless you explicitly call `setTemporal` with it or attach it to `globalThis` yourself.\n\nThis means you can confidently use `Temporal` types in your library’s API surface without bloating your downstream consumers’ bundles.\n\n---\n\n## 📚 Documentation\n\nSee the full API documentation at [agape.dev/api](https://agape.dev/api).\n\n---\n\n## 📦 Agape Toolkit\n\nThis package is part of the [Agape Toolkit](https://github.com/AgapeToolkit/AgapeToolkit) — a comprehensive collection of TypeScript utilities and libraries for modern web development.\n","readmeFilename":"README.md"}