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 🙏

© 2024 – Pkg Stats / Ryan Hefner

chingu-weather-cli

v1.0.2

Published

## Overview

Downloads

4

Readme

Weather CLI

Overview

The Weather CLI is a command-line interface tool built using nodejs and typescript that provides weather information for a specified location. It leverages data from OpenWeatherMap API to deliver current, hourly, and daily weather forecasts.

Features

  • Get current weather information including temperature, conditions, and more.
  • Retrieve hourly forecasts for up to 48 hours.
  • Access daily forecasts for up to 8 days.
  • Set and manage API keys for weather and locationIQ geocode services.

Installation

npm install -g weather-cli

Usage

Running the project locally

  • Clone the project
  • cd <rootdir> and run npm install
  • Run --set-key-weather <key> to set your OpenWeatherMap api key
  • Run --set-key-geocode to set your locationIQ api key
  • Run ts-node ./src/cli.ts <command>
    • Alternatively to use the weather-cli command locally, in the root directory run npm link to globally install the package (don't forget to run npm unlink when you're done)

All available commands

The Weather CLI accepts a maximum of 2 location inputs eg weather-cli paris france and supports the following commands:

  • -f or --farhenheit: Get temperature in Farhenheit.
  • -c or --celsius: Get temperature in Celsius.
  • -h or --help: Display help information.
  • -cr or --current: Get current weather.
  • -mn or --minutely: Get weather forecast by the minute.
  • -hr or --hourly: Get hourly weather forecast.
  • -dy or --daily: Get daily weather forecast.
  • -s or --stat: Get additional weather statistics.
  • --set-c or --set-key-geocode: Set Geocode API key.
  • --set-w or --set-key-weather: Set Weather API key.

To use a command, run weather-cli followed by the desired command and additional options.

Examples

weather-cli --help

help command

Get current forecase
weather-cli lagos -cr

current command selection current command result

Get hourly forecast(48hrs)
weather-cli paris france -hr --stat

hourly command result

Get daily forecasse(8days)
weather-cli chicago -dy

daily command result

Configuration

The CLI tool requires API keys for both OpenWeather and locationIQ geocode services. Use the set-api-key-weather <key> and set-api-key-geocode <key> commands to configure these keys.

Dependencies

DevDependencies
  • @types/node
  • nodemon
  • ts-node
  • typescript
Dependencies
  • dotenv
  • @inquirer/select

To do

  • Add unit tests
  • Implement native cli select feature
  • Implement CI/CD pipeline using github actions
  • Implmenet feature to manage api keys
  • Add more descriptive error messages
  • Add loading spinner
  • Refactor