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

localtime-cli

v0.2.3

Published

Command-line tool to look up the local time (and weather) for time zones, countries and cities with auto-completion.

Downloads

8

Readme

Local time and weather command line tool

Command-line tool to look up the local time (and weather) for time zones, countries and cities with auto-completion.

My partner (:heart: :frog:) was out of town, and I wanted a quick way to see her local time and weather. Fun little project to start using TypeScript too.

Usage

Install as a global localtime command:

npm install -g localtime-cli

Or run ad hoc:

npx localtime-cli

Options

Show full options with localtime --help

  • -t --timezone use timezone names for search (default: true)
  • --no-timezone don't use timezone names
  • -c --country use country names
  • -y --city use city names with a population >= 250,000
  • -Y --city-all use all city names
  • -a --all-min, use all location types (with minimum city population)
  • -A --all use all location types (no city population minimum)
  • -w --weather include local weather
  • -o --openweather-api-key <key> specify OpenWeather API key
  • -o --save-openweather-api-key <key> specify and save OpenWeather API key for future use
  • -l --last bypass location search and reuse last location used
  • -C --metric, use metric units (celsius)
  • -F --imperial, use imperial units (fahrenheit)

Thus localtime -c -y would search time zone, country and larger city names and localtime --no-timezone -Y would search just through all city names, since time zones are always used unless explicitly excluded.

Multiple single letter options can be combined too: localtime -cy.

The last previously used location will be sorted to the top of the list unless --skip-last-used-sort is used.

Weather

Weather info works for city selections and requires a free OpenWeather API key provided via the -o option to use it once or -O to save it for future use without needing to provide it as an option again.

Example:

localtime -y -w -O abc123

In subsequent uses, you can then just run localtime -y -w.

You can also set it via the OPENWEATHER_API_KEY environment variable.

Initially, the metric system will be used and weather temperatures will be in celsius. Subsequent invocations will reuse the previously specified unit of measurement, unless a new one is selected via command line options.

- Joost Schuur (@joostschuur)