DEV Community

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

Posted on • Edited on

3 2

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

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay