This source is modified version of xerik. Thank you for such a brilliant piece of work.
This is basically Javascript implementation of Moshier's ephemeris calculations for sun, planets, comets, asteroids and stars.
Which, initially written by mivion, xerik converted it into a node module. This is a slight customized version with following changes:
- Changes the transit method to get standard sun/moon rise/set times as well as a custom horizon based
- Takes in javascript date object as opposed to a date time string
- Implements a method to just fetch in single planet as opposed to all of it
- Removes html, css bit to keep it focused to one task
- Reformats the code
Installation
npm install ephemeris
Changelog
2.0,.0 Breaking Changes - Please read carefully
- Released 5th July 2020
- Removes dependency on Moment.js and uses JavaScript's default date object
- Fixes names of a few variables as there were typo's (Thanks Erik for these changes)
1.0.0
- Released 30th June 2020
- updates test and fixes test
Usage
app.js
const ephemeris = require('ephemeris');
const dateObj = new Date('2015-08-10T17:09:01.000+08:00');
var result = ephemeris.getAllPlanets(dateObj, 10.0014, 53.5653, 0);
Contributers
This implementation based on code by Steve Moshier.
The inital Javascript code has been written by xerik.
License
GPL-2