npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

weather-terminal-cli

v1.0.2

Published

CLI for getting weather

Readme

Weather Terminal CLI

Command-line utility for getting the current weather by city. The app uses the OpenWeather API, stores the default city and API token locally, and prints the forecast in the terminal.

Features

  • Shows current weather for a saved city.
  • Saves an OpenWeather API token for future runs.
  • Saves a default city for future runs.
  • Allows one-off city/token override through environment variables.
  • Prints weather description, temperature, feels-like temperature, humidity, and wind speed.

Requirements

  • Node.js 18 or newer.
  • npm.
  • OpenWeather API key from https://openweathermap.org/api.

Installation

Install dependencies:

npm install

Run locally from the project directory:

node weather.js

If the package is installed globally or linked locally, the weather command is available because package.json defines a binary entry:

npm link
weather

Configuration

The CLI needs an OpenWeather API token before it can request weather data.

Save the token:

node weather.js -t <API_KEY>

Save the default city:

node weather.js -s Kyiv

The saved configuration is stored in your home directory in:

weather-data.json

The file contains values similar to:

{
  "token": "your-api-key",
  "city": "Kyiv"
}

Usage

Show weather for the saved city:

node weather.js

Show help:

node weather.js -h

Save another default city:

node weather.js -s London

Save another API token:

node weather.js -t <API_KEY>

Override the saved city for one run:

CITY=London node weather.js

Override the saved token for one run:

TOKEN=<API_KEY> node weather.js

On Windows PowerShell, use:

$env:CITY="London"; node weather.js
$env:TOKEN="<API_KEY>"; node weather.js

CLI Options

| Option | Value | Description | | --- | --- | --- | | -h | none | Prints help information. | | -s | city | Saves the default city. | | -t | API key | Saves the OpenWeather API token. |

Environment Variables

| Variable | Description | | --- | --- | | CITY | Overrides the saved city for the current run. | | TOKEN | Overrides the saved token for the current run. |

Project Structure

weather-terminal-cli/
├── helpers/
│   └── args.js              # CLI argument parser
├── services/
│   ├── api.service.js       # OpenWeather API client and icon mapping
│   ├── log.service.js       # Terminal output helpers
│   └── storage.service.js   # Local config storage
├── weather.js               # CLI entry point
├── package.json
└── README.md

API

Weather data is loaded from OpenWeather Current Weather Data API:

https://api.openweathermap.org/data/2.5/weather

The request uses:

  • q — city name.
  • appid — API token.
  • lang=ua — Ukrainian weather descriptions.
  • units=metric — Celsius and metric wind speed.

Scripts

Run the CLI through npm:

npm start

This command executes:

node weather.js

License

ISC