Skip to content

ybudweiser/solcalc

Repository files navigation

solcalc NPM version Build Status Dependency Status Coverage percentage

Discription

solcalc is a JavaScript library for calculating exact sunrise and sunset times for a given location, based on the implementation of the NOAA Solar Calculator.

Disclaimer

Times are mathematically acurate for the given day and final times are not rounded. NOAA Solar Calculator rounds time to the nearest minute and may differ slightly from the results here.

Installation

$ npm install --save solcalc

Usage

const solcalc = require('solcalc');

solcalc.getTimes(/*Moment*/ date, /*Number*/ latitude, /*Number*/ longitude)

Returns an object with the following properties (each is a Moment object):

Property Description
sunrise sunrise
sunset sunrise ends
solarNoon

Usage(Binary)

./solcalc
  Usage: index [options]
  A Javascript module used to calculate sunrise, and sunset based on the NOAA Calculations
  Options:
    -h, --help               output usage information
    -V, --version            output the version number
    -l, --latitude  <n>*     latitude
    -g, --longitude  <n>*    longitude
    -d, --date [YYYY-MM-DD]  date in YYYY-MM-DD format, defaults to current date

License

LGPL-3.0 © yitz

About

A Javascript module used to calculate sunrise, and sunset based on the NOAA Calculations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published