No description
Find a file
2026-06-13 10:30:56 -04:00
.github docs: update README, wiki examples, and CI coverage (P1) 2026-05-30 20:16:06 -04:00
mm-256-75 adding mm-256-75 images 2023-11-14 11:54:46 +07:00
mm-256-85 adding mm-256-85 images 2023-11-14 12:02:14 +07:00
mm-512-75 adding mm-512-75 images 2023-11-14 12:05:55 +07:00
mm-512-85 adding mm-512-85 images 2023-11-14 12:06:43 +07:00
my-256-75 adding my-256-75 images 2023-11-14 12:07:32 +07:00
my-256-85 adding my-256-85 images 2023-11-14 12:08:59 +07:00
my-512-75 adding my-512-75 images 2023-11-14 12:10:57 +07:00
my-512-85 adding my-512-85 images 2023-11-14 12:14:19 +07:00
src ci: fix eslint config and add missing @typescript-eslint devDeps 2026-05-31 08:48:38 -04:00
.editorconfig feat: v2.0.0 — TypeScript rewrite, npm-publishable, off-by-one fix 2026-02-25 15:34:10 -05:00
.gitignore refactor: code quality improvements across the board 2026-03-08 11:32:47 -04:00
.npmrc feat: v2.0.0 — TypeScript rewrite, npm-publishable, off-by-one fix 2026-02-25 15:34:10 -05:00
.nvmrc feat: v2.0.0 — TypeScript rewrite, npm-publishable, off-by-one fix 2026-02-25 15:34:10 -05:00
CHANGELOG.md chore: E6 polish wiki content + ADR-015 CI updates (P1) 2026-05-29 07:15:59 -04:00
eslint.config.mjs ci: fix eslint config and add missing @typescript-eslint devDeps 2026-05-31 08:48:38 -04:00
LICENSE feat: v2.0.0 — TypeScript rewrite, npm-publishable, off-by-one fix 2026-02-25 15:34:10 -05:00
package.json build: use prepack hook so npm pack/publish reliably emit index.d.mts 2026-06-13 10:30:56 -04:00
pnpm-lock.yaml ci: fix eslint config and add missing @typescript-eslint devDeps 2026-05-31 08:48:38 -04:00
pnpm-workspace.yaml feat: v2.0.0 — TypeScript rewrite, npm-publishable, off-by-one fix 2026-02-25 15:34:10 -05:00
README.md docs: update README, wiki examples, and CI coverage (P1) 2026-05-30 20:16:06 -04:00
test-cjs.cjs ci: fix eslint config and add missing @typescript-eslint devDeps 2026-05-31 08:48:38 -04:00
test.mjs ci: fix eslint config and add missing @typescript-eslint devDeps 2026-05-31 08:48:38 -04:00
tsconfig.json chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:13:20 -04:00
tsup.config.ts ci: fix eslint config and add missing @typescript-eslint devDeps 2026-05-31 08:48:38 -04:00
typedoc.json docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0) 2026-05-30 16:42:00 -04:00

moon-cycle

CI License: MIT

Maps any JavaScript Date to the correct NASA moon phase image filename. Two algorithms: synodic-cycle mapping (708 images) and calendar-year mapping (8,760 images).

Not published to npm. The image dataset (~438 MB of hourly WebP photos from NASA's Scientific Visualization Studio) lives in this repository. Use CDN or clone.

Install

# Clone to get code and images together
git clone https://github.com/acamarata/moon-cycle.git

# Or add the code-only package via git
pnpm add github:acamarata/moon-cycle

Quick Start

import { cycleMonth, cdnUrl } from 'moon-cycle';

const filename = cycleMonth();                     // e.g. "354.webp"
const url = cdnUrl(filename, 'mm', 256, 75);
// => 'https://cdn.jsdelivr.net/gh/acamarata/moon-cycle@main/mm-256-75/354.webp'

CommonJS:

const { cycleMonth, cdnUrl } = require('moon-cycle');

Documentation

Full reference: GitHub Wiki

Acknowledgments

Moon phase imagery from NASA's Scientific Visualization Studio:

Ernie Wright (2023). Moon Phase and Libration, 2023 [Data set]. NASA Scientific Visualization Studio. https://svs.gsfc.nasa.gov/5187

Images are in the public domain per NASA's media usage guidelines.

License

MIT. See LICENSE for the full text.