Git Product home page Git Product logo

sunrise-cli's Introduction

Sunrise cli logo

sunrise-cli

Get the sunrise and sunset for your location or target, right from your terminal!

npm (scoped) npm

Build Status Codecov Coverage semantic-release Known Vulnerabilities GitHub license

Motivation

Developers rarely take their eyes from the terminal, completely disregarding what's it like outside.

With this cli I can now easily and quickly check how it is currently.

Me during the day meme

Installation

Note: you can also use npx! See example section.

To intall the cli run:

$ yarn global add @varandas/sunrise-cli

OR with NPM

$ npm install -g @varandas/sunrise-cli

And that's it, you're now empowered!

Usage

In order to check how it is outside, please just use the following command:

$ sunrise

The cli also accepts a few arguments:

  • --help - get help on the cli usage.
  • --lat - specifies location latitude.
  • --long - specifies location longitude.
  • --extended - adds more details to the response.
  • --ip - specifies the ip to use for the location.

Example

Get sunrise/sunset details for New York

If you're using npx as an alternative, you can replace $ sunrise with $ npx @varandas/sunrise-cli before passing in the arguments.

$ npx @varandas/sunrise-cli --lat 40.730610 --long -73.935242

With global install

$ sunrise --lat 40.730610 --long -73.935242

Response

The regular response includes:

  • Sunrise
  • Sunset
  • Solar Moon
  • Day Length
$ sunrise

Sunrise cli example call

The extended response includes:

  • Sunrise
  • Sunset
  • Solar Moon
  • Day Length
  • Civil Twilight Begin
  • Civil Twilight End
  • Nautical Twilight Begin
  • Nautical Twilight End
  • Astronomical Twilight Begin
  • Astronomical Twilight End

Sunrise cli extended call

It is reaaaly extended, make sure you have a wide terminal window.

Credits

This project was only possible thanks to the awesome team at Sunrise Sunset.

LICENSE

MIT License

Copyright (c) 2020 André Varandas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

sunrise-cli's People

Contributors

andrevarandas avatar dependabot[bot] avatar drebrez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sunrise-cli's Issues

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

feature: Add new optional argument --date

`https://api.sunrise-sunset.org/json?lat=${this.lat}&lng=${this.long}&formatted=0`

We would like to also include the an optional parameter date to the api call as in the docs:

date (string): Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional.

The date should be picked up by the cli and added as an optional string parameter to cli.ts as --date and -d for short.
Usage should be something like $ sunrise -d 2020-12-24.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.