DEV Community

Cover image for Building an Asynchronous Weather Application with the core of Node.JS
Kater Akeren
Kater Akeren

Posted on • Updated on

Building an Asynchronous Weather Application with the core of Node.JS

What is Node.JS?

Node.JS is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient to build fast, adaptive, and network applications.

Asynchronous

It is a simple workable technique to perform long network requests without blocking the main thread. This makes use of callbacks, promises, and async/await to achieve asynchronously.

Overview

The program consists of only two functions (forecast and geocode) in the utils directory and an entry point to the application called app.js. The user is required to provide a location name that is converted behind the scene to coordinates pairs (Longitude and Latitude) that are then passed to the forecast function to display the current location weather with a report briefly.

Features

  • Forcast using the Darksky API
  • Geocoding using the Mapbox API
  • Inputs from Command Line Interface (CLI)

Github Repository

Result Screenshot

Alt Text

Validation Error Message

Alt Text

Code snippets

Alt Text
Alt Text
Alt Text

Top comments (0)