An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

Daylight
========

[![Build Status](https://travis-ci.org/modern-dev/daylight.svg?branch=master)](https://travis-ci.org/modern-dev/daylight)
[![codecov](https://codecov.io/gh/modern-dev/daylight/branch/master/graph/badge.svg)](https://codecov.io/gh/modern-dev/daylight)
![npm](https://img.shields.io/npm/v/@modern-dev/daylight)
![NPM](https://img.shields.io/npm/l/@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)