https://github.com/modern-dev/daylight
Daylight - is a tiny JavaScript library for basic sun/moon position/times/phase calculations.
https://github.com/modern-dev/daylight
astro astronomical civil dawn daylight dusk moonrise moonset nautical phase sunrise sunset twilight
Last synced: about 2 months ago
JSON representation
Daylight - is a tiny JavaScript library for basic sun/moon position/times/phase calculations.
- Host: GitHub
- URL: https://github.com/modern-dev/daylight
- Owner: modern-dev
- License: mit
- Created: 2015-11-28T11:53:45.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-01-11T23:24:23.000Z (over 5 years ago)
- Last Synced: 2025-08-09T22:58:14.242Z (about 2 months ago)
- Topics: astro, astronomical, civil, dawn, daylight, dusk, moonrise, moonset, nautical, phase, sunrise, sunset, twilight
- Language: TypeScript
- Homepage:
- Size: 27.3 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Daylight
========[](https://travis-ci.org/modern-dev/daylight)
[](https://codecov.io/gh/modern-dev/daylight)

Daylight - is a tiny JavaScript library for basic sun/moon position/times/phase calculations.
```shell script
$ npm install -save @modern-dev/daylight
```## :clipboard: Usage
```js
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);
```## :mortar_board: API Reference
*Will be added soon.*## :green_book: License
[Licensed under the MIT license.](https://github.com/modern-dev/daylight/blob/master/LICENSE)
Copyright (c) 2020 Bohdan Shtepan
---
> [modern-dev.com](http://modern-dev.com) ·
> GitHub [@virtyaluk](https://github.com/virtyaluk) ·
> Twitter [@virtyaluk](https://twitter.com/virtyaluk)