mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-03-24 01:13:30 -04:00
JavaScript examples for Node.js
The source file astronomy.js works as a Node.js module. Download the file into your project directory. Then in your own source file, do this:
const Astronomy = require('astronomy.js');
There are no external dependencies!
Astronomy Engine is completely self-contained, and it always will be.
(By the way, you can use the same file astronomy.js for
astronomy calculations inside the browser.)
Moon Phase Calculator
This example shows how to determine the Moon's current phase, and how to predict when the next few quarter phases will occur.
API Reference
Complete documentation for all the functions and types available in the JavaScript version of Astronomy Engine.