GithubHelp home page GithubHelp logo

node-async-weather's Introduction

node-async-weather

A simple Node Weather Application


Node js application that accepts a location input or uses the users IP address to determine the users location. Once location is established, the current weather is provided for said location. This application utilizes:


###HACKTOBERFEST! This project was featured during DigitalOcean's 2016 HACKTOBERFEST! Thanks to everyone who contributed in both discussion and coding!


How to run the app locally:

  1. Run npm install to install all needed dependencies.

  2. Navigate to OpenWeatherMap's and get a free API key.

  3. Set your API Key. There are two methods:

    • Set an environment variable: API_KEY

      Example: API_KEY=yourKeyHere

      Windows Example: SET API_KEY=yourKeyHere

    • Create a .env file in the root of the project with the content of API_KEY=yourKeyHere

  4. Request the weather for your current location (as determined by IP) by running: npm start

    • Specify any location by using the location flag: npm start -- -l Boston
  5. Request the weather forecast for your current location (as determined by IP) by running: npm start -- -f

    • Specify any location as you would with the location flag: npm start -- -f Denver
    • Note that you can specify only one location for both parameters or specify the location for both parameters

node-async-weather's People

Contributors

beatfreaker avatar bmorelli25 avatar kylec32 avatar m5r avatar wimpykid26 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-async-weather's Issues

Refactor Environment Variable (process.env.API_KEY)

Hello Hacktoberfest!

Are you interested in Node JS, and/or APIs? Then you've come to the right project! This command line app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user.

If React JS, Node JS, APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS is more your thing, check out my other Hacktoberfest Project: React-Weather-App! There are numerous issues to be solved - for all programming levels!

Your task: Environment variables! Currently the environment variable API_KEY is passed into to projected via the command prompt. While this isn't a bad thing, it would be easier if a .env file was created and utilized with dotenv.

Don't hesitate to reach out with questions, or if you need help understanding the code!

Have an idea for a different improvement? Awesome. I'll be opening up new issues all throughout Hacktoberfest - and please feel free to do the same! Want to implement a new feature, or found a bug? Open a new issue and start writing code!!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Utilize OpenWeatherMap's API to return additional weather data (yargs, API, node)

Hello Hacktoberfest!

Are you interested in Node JS, and/or APIs? Then you've come to the right project! This command line app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user.

If React JS, Node JS, APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS is more your thing, check out my other Hacktoberfest Project: React-Weather-App! There are numerous issues to be solved - for all programming levels!

Your task: Utilize OpenWeatherMaps API and return even more great data to the user. Using the 5 day/3 hour API, return the 5 day forecast for the searched city if a user uses the -f flag or -forecast command. For help on how to do this, you can see my previous project node-password-manager/app.js.

Don't hesitate to reach out with questions, or if you need help understanding the code!

Have an idea for a different improvement? Awesome. I'll be opening up new issues all throughout Hacktoberfest - and please feel free to do the same! Want to implement a new feature, or found a bug? Open a new issue and start writing code!!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Blocked scope declarations not yet supported

Getting following error while running npm start -- -l Pune

/home/ubuntu/workspace/node-async-weather/app.js:2
let weather = require('./weather.js');
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

seems 'use strict'; needs to be added in .js files

can i submit PR for the same?

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.