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-cli-16bit

v0.3.60

Published

A simple, intelligent weather CLI with smart location detection - no quotes needed

Readme

weather-cli-16bit v0.3.59

npm version CI License Node.js

Part of the 16bitweather suite of weather tools.

A command-line weather application with smart location parsing, responsive terminal display, and secure API key storage.

No quotes needed — just type weather San Ramon CA from anywhere on your system.

Installation

NPM Global Install (Recommended)

npm install -g weather-cli-16bit
weather San Francisco CA

From Source

git clone https://github.com/deephouse23/weather-cli.git
cd weather-cli
npm install
npm link

Requirements

Setup

# Secure API key setup (recommended — stores in OS keychain)
weather auth set

# Test your API key
weather auth test

# Alternative: environment variable
cp .env.example .env
# Edit .env and add your OpenWeatherMap API key

Usage

US States & Cities (no quotes needed)

weather CA                    # California
weather NY                    # New York
weather San Ramon CA          # San Ramon, California
weather San Francisco         # Auto-detects SF

International

weather London                # Auto-detects UK
weather Tokyo                 # Auto-detects Japan
weather BC                    # British Columbia, Canada
weather Ontario               # Ontario, Canada

All Commands

# Current weather
weather San Ramon             # City name
weather San Ramon CA          # City, State
weather London                # International
weather 94583                 # US Zip code

# Forecasts
weather forecast London       # 24-hour forecast
weather 5day Tokyo            # 5-day forecast

# Compare & coordinates
weather compare "New York" London
weather coords 37.7749,-122.4194

# ASCII Art (animated)
weather San Francisco --art --animate

# Interactive mode
weather                       # No arguments starts interactive mode

# Configuration & cache
weather config                # Set default location and units
weather cache                 # View cache statistics
weather cache -c              # Clear cache

# Authentication
weather auth set              # Store API key securely
weather auth test             # Validate your API key

Temperature Units

# Automatic regional detection
weather London                # UK = Celsius
weather "New York"            # US = Fahrenheit

# Force specific units
weather Tokyo --celsius
weather Paris --fahrenheit
weather Berlin -u metric
weather Sydney -u imperial

Display

╭──────────────────────────────────────────────────────────────────────────────────╮
│                                                                                  │
│   San Ramon, US                                    Sunrise: 06:16 AM             │
│   clear sky                                        Sunset: 08:10 PM              │
│   82°F                                             Air Quality: Good (AQI: 1)    │
│   Feels like: 82°F                                 Min: 73°F / Max: 88°F         │
│   Humidity: 44%                                     Wind: 5.99 mph               │
│   Pressure: 1015 hPa                                Visibility: 10km             │
│                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────╯

Responsive layout adapts to terminal width (compact, medium, and full views).

Architecture

src/
├── weather.js           # API calls and weather logic
├── cache.js             # Caching with expiration
├── display.js           # Terminal formatting and output
├── config.js            # Configuration management
├── api/
│   ├── auth.js          # Secure authentication (keytar)
│   └── http.js          # HTTP client with retry logic
└── utils/
    ├── errors.js        # Error handling utilities
    ├── locationParser.js # Smart location parsing
    └── validators.js    # Input validation

tests/unit/
├── cache.test.js        # Cache expiry, eviction, persistence
├── config.test.js       # Config load/save, temp options
├── display.test.js      # Formatting, air quality, data rows
├── errors.test.js       # WeatherError, exit code mapping
├── http.test.js         # Retry config, rate limiting
├── locationParser.test.js # 17 location format tests
├── validators.test.js   # Sanitization, coordinates, bounds
└── weather.test.js      # Unit detection, temp conversion

Features

  • Smart Location Parsing — no quotes needed, supports US states, Canadian provinces, country codes
  • Secure API Keys — OS keychain via keytar, fallback to env var
  • Smart Caching — 30-minute expiry, 100-entry limit, LRU eviction
  • Responsive Display — adapts to terminal width with color-coded output
  • Forecasts — 24-hour and 5-day, city comparison, GPS coordinates
  • Retry Logic — exponential backoff for network issues
  • Animated ASCII Art — animated weather scenes with --art --animate

Development

Prerequisites

  • Node.js v18+
  • npm

Scripts

npm test                 # Run all tests (Vitest)
npm run test:watch       # Watch mode
npm run test:coverage    # With coverage
npm run lint             # ESLint
npm run lint:fix         # ESLint with auto-fix
npm run format           # Prettier format
npm run format:check     # Check formatting
npm run dev              # Dev mode with auto-restart

Quality Tools

  • Vitest — 104 unit tests across 8 test files
  • ESLint v9 — flat config with Prettier integration
  • Prettier — consistent code formatting
  • Husky — pre-commit hook runs lint-staged
  • GitHub Actions CI — lint + test matrix (Node 18, 20, 22)

Contributing

  1. Fork the repo
  2. Create feature branch: git checkout -b feature/my-feature
  3. Run checks: npm test && npm run lint
  4. Commit and push
  5. Open PR — auto-publishes to npm when merged

Command Reference

| Command | Description | | --------------------------------- | -------------------------- | | weather [location] | Current weather | | weather now [location] | Current weather (explicit) | | weather forecast [location] | 24-hour forecast | | weather 5day [location] | 5-day forecast | | weather compare <city1> <city2> | Compare two cities | | weather coords <lat,lon> | Weather by GPS | | weather config | Set defaults | | weather cache | View cache stats | | weather cache -c | Clear cache | | weather auth set | Store API key | | weather auth test | Test API key |

Options

| Option | Description | | -------------------- | ---------------------------------------- | | -u, --units <type> | Temperature units (metric/imperial/auto) | | --celsius | Force Celsius display | | --fahrenheit | Force Fahrenheit display | | -f, --forecast | Include 24-hour forecast | | -a, --alerts | Show weather alerts | | --art | Display ASCII art weather scene | | --animate | Animate the ASCII art scene |

License

MIT — see LICENSE.

Links