codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Follow publication

Member-only story

Build a Command Line Interface (CLI) Application with Node.js

Node.js is so popular today and the Node.js community has established a rich ecosystem with over 1 million npm packages, a portion of which are related to command line interface (CLI) tools. You must have used some famous CLI tools in React, Angular, or Vue.js. How about we build one for ourselves?

In this post, we will create a Node.js CLI program to query weather data from the OpenWeatherMap API services. This CLI application handles user specific configurations and user commands for checking current weather and weather forecasts. Let’s take a look at the demo in the following screen recording.

You can check out the full project in this GitHub repository. Now, let’s dive in and build this CLI app step by step.

Table of Contents

Register the OpenWeatherMap API Service
Make a Bare-bones CLI Program with Node.js
Brush up the Weather CLI Application
Store and Retrieve Configurations for Our CLI Application
Get and Show the Weather Data
Publish the CLI Application to the npm Registry

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Written by Changhui Xu

Lead Application Developer. MBA. I write blogs about .NET, Angular, JavaScript/TypeScript, Docker, AWS, DDD, and many others.

Responses (1)

Write a response