{"_id":"@0xf3cd/celestial","_rev":"2-5ef93d97f8a310600861a80f0486786b","name":"@0xf3cd/celestial","dist-tags":{"latest":"0.6.1"},"versions":{"0.6.0":{"name":"@0xf3cd/celestial","version":"0.6.0","keywords":["astronomy","chinese-calendar","lunar-calendar","jieqi","webassembly"],"license":"GPL-3.0-or-later","_id":"@0xf3cd/celestial@0.6.0","maintainers":[{"name":"0xf3cd","email":"nq.maigre@gmail.com"}],"homepage":"https://github.com/0xf3cd/celestial-calendar","bugs":{"url":"https://github.com/0xf3cd/celestial-calendar/issues"},"dist":{"shasum":"731726e62da4d21a921f632e82426c580afd7de8","tarball":"https://registry.npmjs.org/@0xf3cd/celestial/-/celestial-0.6.0.tgz","fileCount":8,"integrity":"sha512-f1ilqGAmIGMBUD/U7bWl+F/0Ys0MKMKkxk7BZgf/2cMStQEEDYrMb12z1Ro42soNhb8jqf78g/7k3s6aRW4F8g==","signatures":[{"sig":"MEUCIQCh/Y0JK0eASNZqvIQx2MlpMkeew7h8DwfNFOJh3sgOXwIgT+H571KrjRZE4hz0yw2hLauJiYlHKjroNUn7sIpx+0s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":521943},"type":"module","_from":"file:/tmp/v060-release/npm-bootstrap/0xf3cd-celestial-0.6.0.tgz","types":"./index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","default":"./index.mjs"}},"_npmUser":{"name":"0xf3cd","email":"nq.maigre@gmail.com"},"_resolved":"/tmp/v060-release/npm-bootstrap/0xf3cd-celestial-0.6.0.tgz","_integrity":"sha512-f1ilqGAmIGMBUD/U7bWl+F/0Ys0MKMKkxk7BZgf/2cMStQEEDYrMb12z1Ro42soNhb8jqf78g/7k3s6aRW4F8g==","repository":{"url":"git+https://github.com/0xf3cd/celestial-calendar.git","type":"git","directory":"bindings/javascript"},"_npmVersion":"11.19.0","description":"Astronomical calculations and Chinese calendar conversion powered by CelestialCalendar WebAssembly","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/celestial_0.6.0_1787528909957_0.5488457416477872","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"name":"@0xf3cd/celestial","version":"0.6.1","description":"Astronomical calculations and Chinese calendar conversion powered by CelestialCalendar WebAssembly","type":"module","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","default":"./index.mjs"}},"types":"./index.d.ts","engines":{"node":">=22"},"repository":{"type":"git","url":"git+https://github.com/0xf3cd/celestial-calendar.git","directory":"bindings/javascript"},"homepage":"https://github.com/0xf3cd/celestial-calendar","keywords":["astronomy","chinese-calendar","lunar-calendar","jieqi","webassembly"],"license":"GPL-3.0-or-later","publishConfig":{"access":"public"},"_id":"@0xf3cd/celestial@0.6.1","bugs":{"url":"https://github.com/0xf3cd/celestial-calendar/issues"},"_integrity":"sha512-IRLrSJqeMH8AYOoNBc0V5judUeFd6MCvRKxRbQYzKzRHHBidnst57+0BeMQTBPiLGDk0eOy8yUDLhVsx2O9BIw==","_resolved":"/home/runner/work/celestial-calendar/celestial-calendar/candidate/npm/0xf3cd-celestial-0.6.1.tgz","_from":"file:candidate/npm/0xf3cd-celestial-0.6.1.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-IRLrSJqeMH8AYOoNBc0V5judUeFd6MCvRKxRbQYzKzRHHBidnst57+0BeMQTBPiLGDk0eOy8yUDLhVsx2O9BIw==","shasum":"95dc239ed0c0fab75d4a82e5df3c24c33de53029","tarball":"https://registry.npmjs.org/@0xf3cd/celestial/-/celestial-0.6.1.tgz","fileCount":8,"unpackedSize":521943,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@0xf3cd%2fcelestial@0.6.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDJ/vgtultYJSp/dMzs/HaxxmBvXZ4XdMjg8RXmvyn48AiEAwV2Y4I1QMTksMLR6D/m/8pdeZp+9G2jzk4thOpKzByQ="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8c2349ed-6fc3-43c3-8096-5e547a63da3d"}},"directories":{},"maintainers":[{"name":"0xf3cd","email":"nq.maigre@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/celestial_0.6.1_1787594052438_0.8685091015516537"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T23:48:29.774Z","modified":"2026-08-24T17:54:12.990Z","0.6.0":"2026-08-23T23:48:30.109Z","0.6.1":"2026-08-24T17:54:12.674Z"},"bugs":{"url":"https://github.com/0xf3cd/celestial-calendar/issues"},"license":"GPL-3.0-or-later","homepage":"https://github.com/0xf3cd/celestial-calendar","keywords":["astronomy","chinese-calendar","lunar-calendar","jieqi","webassembly"],"repository":{"type":"git","url":"git+https://github.com/0xf3cd/celestial-calendar.git","directory":"bindings/javascript"},"description":"Astronomical calculations and Chinese calendar conversion powered by CelestialCalendar WebAssembly","maintainers":[{"name":"0xf3cd","email":"nq.maigre@gmail.com"}],"readme":"<!--\n  CelestialCalendar:\n    A C++23-style library that performs astronomical calculations and date conversions among various calendars,\n    including Gregorian, Lunar, and Chinese Ganzhi calendars.\n\n  Copyright (C) 2026 Ningqi Wang (0xf3cd)\n  Email: nq.maigre@gmail.com\n  Repo : https://github.com/0xf3cd/celestial-calendar\n\n  This project is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This project is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this project. If not, see <https://www.gnu.org/licenses/>.\n-->\n\n# @0xf3cd/celestial\n\nAstronomical calculations and Chinese calendar conversion from\n[CelestialCalendar](https://github.com/0xf3cd/celestial-calendar), distributed as one ESM package with its own\nWebAssembly module.\n\n## Install\n\nInstall the package from npm:\n\n```sh\nnpm install @0xf3cd/celestial\n```\n\nThe matching [GitHub release](https://github.com/0xf3cd/celestial-calendar/releases) also carries\n`celestial-wasm.zip`, including the exact tarball published to npm and its SHA-256 sidecar.\n\nNode 22 or newer is supported. The browser package is tested on Chrome. Importing the package performs no I/O;\ncall `init()` once before using the synchronous calculation APIs.\n\n```js\nimport * as celestial from \"@0xf3cd/celestial\";\n\nawait celestial.init();\n\nconst moon = celestial.moon.illumination(2448724.5);\nconst lichun = celestial.jieqi.moment(2026, 0);\nconsole.log(moon.fraction, lichun, celestial.jieqi.name(0));\n```\n\nConcurrent and repeated `init()` calls share one initialization. If loading fails, a later explicit call may retry.\n\n## API\n\nThe package exposes `config`, `time`, `sun`, `moon`, `jieqi`, and `lunar` namespaces. TypeScript declarations ship\nwith the package; enum-like inputs are string unions such as `\"full\"`, `\"algo3\"`, and `\"debug\"`.\n\nTime scales and units stay explicit:\n\n- JD inputs and outputs are named as UT1 or JDE (TT) by the operation.\n- Jieqi moments are UT1 civil moments.\n- `sun.apparentSolarTime()` accepts civil UTC and east-positive longitude.\n- Angular results use degrees; Sun distance uses AU and Moon distance uses kilometres.\n- `time.deltaT()` returns seconds.\n- The equation of time is degrees of hour angle; multiply by 240 for seconds of time.\n\n`jieqi.moment(year, index)` accepts Gregorian years in `[401, 32766]` and Jieqi indices in `[0, 23]`.\n`sun.longitudeCrossings(year, longitudeDeg)`, `moon.phaseMoments(year, phase)`, and `moon.newMoonsInYear(year)` accept\nGregorian years in `[1, 32766]`.\nLunar conversions use algorithm-specific year windows; query them with `lunar.supportedYearRange(algorithm)`.\n\n`time.deltaT(year, model)` accepts a finite decimal Gregorian year. Three models have additional bounds:\n\n| Model | Year domain |\n|---|---|\n| `\"algo1\"` | `year >= -4000` |\n| `\"algo3\"` | `year < 3000` |\n| `\"algo4\"` | `year < 2035` |\n\n`\"default\"`, `\"algo2\"`, and `\"algo5\"` have no model-specific year bound.\n\nJavaScript `Date` is intentionally not accepted because it represents UTC milliseconds, not UT1 or TT.\n\nBad shapes and types throw `TypeError`; JavaScript range guards throw `RangeError`. Native failures throw\n`CelestialError`, whose `operation` names the public method and whose `recorded` flag says whether the message came\nfrom the native error channel. A legitimate absence remains `null` or `[]`.\n\n`moon.newMoonsAfter(jde, count)` accepts `count` in `[0, 4096]`; zero returns `[]`. The upper bound keeps the WASM\noutput buffer at or below 32 KiB, matching the Python package.\n\n## 中文\n\n`@0xf3cd/celestial` 把 CelestialCalendar 的天文计算与公历/阴历转换包装为一个自带 WebAssembly 的\nESM 包。Node 需要 22 或更新版本；浏览器端在 Chrome 上测试。\n\n```js\nimport * as celestial from \"@0xf3cd/celestial\";\n\nawait celestial.init();\nconst result = celestial.lunar.fromGregorian(\"algo3\", { year: 2026, month: 8, day: 15 });\n```\n\n包只提供 `jieqi` / `lunar` 这一套正式命名，不另设 `solarTerms` / `lunarCalendar` 别名。时间尺度、\n经度符号与单位见上面的 API 契约；不要把 JavaScript `Date` 隐式当作 UT1 或 TT。\n\n## License\n\nGPL-3.0-or-later.\n","readmeFilename":"README.md"}