Daylight - is a tiny JavaScript library for basic sun/moon position/times/phase calculations.
$ npm install -save @modern-dev/daylight
import { sun, moon } from '@modern-dev/daylight';
const sunPosition = sun.getPosition(new Date(), 90.0, 45.0);
console.log('Sun\'s altitude at the South Pole is ', sunPosition.altitude);
const moonPahse = moon.getPhase(new Date());
console.log('Today\'s moon phase is ', moonPhase.phase);
Will be added soon.
Licensed under the MIT license.
Copyright (c) 2020 Bohdan Shtepan
modern-dev.com · GitHub @virtyaluk · Twitter @virtyaluk