{"_id":"@aigne/lunarphase-calculator","name":"@aigne/lunarphase-calculator","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@aigne/lunarphase-calculator","version":"1.1.0","description":"Lunar phase calculator — Cloudflare-Workers-safe port of lunarphase-calculator (antonyMeow/Moon-Phase-Calculator, ISC) for the ARC monorepo","license":"ISC","publishConfig":{"access":"public"},"author":{"name":"Arcblock","email":"blocklet@arcblock.io"},"homepage":"https://github.com/arcblock/arc","repository":{"type":"git","url":"git+https://github.com/arcblock/arc.git"},"bugs":{"url":"https://github.com/arcblock/arc/issues"},"type":"module","main":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./*":"./*"},"devDependencies":{"@types/bun":"^1.3.6","npm-run-all":"^4.1.5","rimraf":"^6.1.2","tsdown":"0.20.0-beta.3","typescript":"5.9.2","@aigne/typescript-config":"0.0.0"},"scripts":{"build":"tsdown","check-types":"tsc --noEmit","clean":"rimraf dist coverage","test":"bun test","test:coverage":"bun test --coverage --coverage-reporter=lcov --coverage-reporter=text"},"_id":"@aigne/lunarphase-calculator@1.1.0","_integrity":"sha512-rFv4Y8xIMnAaCD9TVRn8xckQiCQZfjB/Tr0aXVz5tAFwIPOCOcq7U6bfvP0GD6RNxGArc7hBmCZzKTMHadaZyA==","_resolved":"/tmp/a0dface29229ddb70f9965c0d8a00d21/aigne-lunarphase-calculator-1.1.0.tgz","_from":"file:aigne-lunarphase-calculator-1.1.0.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-rFv4Y8xIMnAaCD9TVRn8xckQiCQZfjB/Tr0aXVz5tAFwIPOCOcq7U6bfvP0GD6RNxGArc7hBmCZzKTMHadaZyA==","shasum":"f410781715742b2a7f688f7b9eb007640996b9c2","tarball":"https://registry.npmjs.org/@aigne/lunarphase-calculator/-/lunarphase-calculator-1.1.0.tgz","fileCount":22,"unpackedSize":46860,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCs5w96ajnaeHQ3OXP1SvieTfaaujaPmYNJSg57EtcCAQIhAM1eTzesQJuOGVPkgH4nNIpk269RKIUpm9iTsQkVmWEA"}]},"_npmUser":{"name":"wangshijun","email":"shijun@arcblock.io"},"directories":{},"maintainers":[{"name":"li-yechao","email":"liyechao@yechao.xyz"},{"name":"wangshijun","email":"shijun@arcblock.io"},{"name":"mave99a","email":"rob@arcblock.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lunarphase-calculator_1.1.0_1783926919917_0.2549009506831066"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-13T07:15:19.819Z","1.1.0":"2026-07-13T07:15:20.077Z","modified":"2026-07-13T07:15:20.360Z"},"maintainers":[{"name":"li-yechao","email":"liyechao@yechao.xyz"},{"name":"wangshijun","email":"shijun@arcblock.io"},{"name":"mave99a","email":"rob@arcblock.io"}],"description":"Lunar phase calculator — Cloudflare-Workers-safe port of lunarphase-calculator (antonyMeow/Moon-Phase-Calculator, ISC) for the ARC monorepo","homepage":"https://github.com/arcblock/arc","repository":{"type":"git","url":"git+https://github.com/arcblock/arc.git"},"author":{"name":"Arcblock","email":"blocklet@arcblock.io"},"bugs":{"url":"https://github.com/arcblock/arc/issues"},"license":"ISC","readme":"# @aigne/lunarphase-calculator\n\nCloudflare-Workers-safe port of [`lunarphase-calculator`](https://github.com/antonyMeow/Moon-Phase-Calculator) for the ARC monorepo. Pure JavaScript math — no Node-specific APIs (`node:*` / `fs` / `Buffer` / `process`), CF-Worker compatible per ARC L6 / L11 / Q21.\n\n## Provenance\n\n- **Upstream**:[`antonyMeow/Moon-Phase-Calculator`](https://github.com/antonyMeow/Moon-Phase-Calculator)(ISC license)\n- **Original npm**:`lunarphase-calculator@1.1.0`(已于 2025-03-18 unpublished — 这是 cp 进 ARC 作为 workspace 包的根本原因)\n- **ARC port date**:2026-05-28(Phase 0 of `planning/aistro-arc-migration/`)\n- **Q17 关闭决定**:[`planning/aistro-arc-migration/README.md` §Q17](../../planning/aistro-arc-migration/README.md)\n\n## ARC 改造记录\n\n| 项目 | 操作 |\n|------|------|\n| `src/lunarCalculator.js` + `src/{calculations,exceptions,ASCII-arts}/*.{js,json}` | **直接 cp**(无逻辑改动) — 保持上游 API 兼容 |\n| `src/index.ts` | **新增** TypeScript wrapper,re-export 主接口 + `LunarPhase` union type |\n| `src/lunarCalculator.d.ts` | **新增** type declaration,声明 CommonJS module shape |\n| `src/types.ts` | **新增** `LunarPhase` 类型定义 |\n| 原 `package.json` devDeps(eslint / prettier / husky 等)| 删除 — 统一走 ARC 根级 Biome + 工具 |\n| `LICENSE` | 保留 ISC,加 ARC port copyright |\n| `node:*` / `Buffer` / `process` 引用 | **扫描确认 0 处**(Q21 兼容性) |\n\n## API\n\n```ts\nimport {\n  getLunarDay,\n  getLunarPhase,\n  getFullLunarPhase,\n  getLunarPhaseMonth,\n  toJDN,\n  fromJDN,\n  drawASCII,\n  ASCIIArts,\n  phases,\n  type LunarPhase,\n} from \"@aigne/lunarphase-calculator\";\n\n// 月相日(0 ~ 29.53):\nconst day = getLunarDay(new Date()); // number\n\n// 月相名:\nconst phase = getLunarPhase(day); // \"FULL_MOON\" | ...\n\n// ASCII art + 日期:\nconsole.log(getFullLunarPhase(new Date()));\n\n// 当月每日月相:\nconst monthly = getLunarPhaseMonth(new Date()); // LunarPhase[]\n\n// Julian Day Number 转换:\nconst jdn = toJDN(new Date());           // number\nconst [y, m, d] = fromJDN(jdn);          // [year, month, day]\n\n// 单独画 ASCII art:\nconsole.log(drawASCII(\"FULL_MOON\"));\n```\n\n完整原始 API 描述见 [upstream README](https://github.com/antonyMeow/Moon-Phase-Calculator#readme)。\n\n## License\n\nISC — 详见 [`LICENSE`](./LICENSE)。\n","readmeFilename":"README.md","_rev":"1-9697382cf832dc7562f6910a3754cac4"}