moon-sighting/.github/wiki/api/functions/getMoon.md
Aric Camarata 2992dcee21 docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0)
Add typedoc and typedoc-plugin-markdown as devDependencies. Add typedoc.json config
targeting src/index.ts with markdown output to .github/wiki/api. Add docs script to
package.json. Generate initial API reference pages.

Part of T-E8-03 — TypeDoc automation for all 12 JS/TS packages.
2026-05-30 16:41:59 -04:00

1.4 KiB

moon-sighting v1.1.1


moon-sighting / getMoon

Function: getMoon()

getMoon(date?, lat, lon, elevation?): MoonSnapshot

Defined in: api/index.ts:727

Combined kernel-free moon snapshot for a time and location.

Calls getMoonPhase(), getMoonPosition(), getMoonIllumination(), and getMoonVisibilityEstimate() in a single request. Convenient for dashboards and apps that need all four values together.

Works WITHOUT a kernel (all Meeus-based approximations).

Parameters

date?

Date = ...

Date and time (default: now)

lat

number

Observer geodetic latitude in degrees (north positive)

lon

number

Observer longitude in degrees (east positive)

elevation?

number = 0

Observer height above WGS84 ellipsoid in meters (default: 0)

Returns

MoonSnapshot

MoonSnapshot with phase, position, illumination, and visibility estimate

Example

const moon = getMoon(new Date(), 51.5, -0.1)
console.log(moon.phase.phaseName)          // 'Waxing Crescent'
console.log(moon.position.altitude)        // degrees above horizon
console.log(moon.illumination.fraction)    // 0.0 to 1.0
console.log(moon.visibility.zone)          // 'A' through 'D'