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

ggfonts

v1.0.4

Published

A CLI tool to search and install Google Fonts

Downloads

13

Readme

Google Fonts CLI

Project version Project issues NPM downloads Project license

A CLI tool to search and install fonts from https://fonts.google.com/

Installation

npm install -g ggfonts

Usage

Syntax: ggfonts [options] [command]

Options:
  -v, --version            display version number
  -h, --help               display help for command

Commands:
  config [options]         Config Google Fonts API Key. If no API key is provided, a pre-downloaded Google Fonts metadata will be used.
  update                   Update Google Fonts metadata
  search [options] <name>  Search font
  install <name>           Install font
  help [command]           display help for command

Configure Google Fonts API Key

Follow instructions to get API Key from https://developers.google.com/fonts/docs/developer_api

Usage

Syntax: ggfonts config [options]

Config Google Fonts API Key. If no API key is provided, a pre-downloaded Google Fonts metadata will be used.

Options:
  -k, --key <key>  API Key
  -h, --help       display help for command

Example

# Set your API key
ggfonts config -k YOUR_GOOGLE_FONTS_API_KEY

# Remove API Key and use the default config
ggfonts config

Update Google Fonts metadata

Usage

Syntax: ggfonts update [options]

Options:
  -h, --help  display help for command

Example

ggfonts update

Search font

Usage

Syntax: ggfonts search [options] <name>

Arguments:
  name                font name.

Options:
  -m, --max <result>  max result limit (default: 10)
  -h, --help          display help for command

Example

# Full-text search is supported
ggfonts search 'op san'

# OUTPUT:
# [INFO]  Search font by keyword: op san
# [INFO]  Found 2 fonts:
# [INFO]   1. Open Sans
# [INFO]   2. Ropa Sans

ggfonts search -m 5 rains
# ggfonts search -m=5 rains
# ggfonts search --max 5 rains
# ggfonts search --max=5 rains

# OUTPUT:
# [INFO]  Search font by keyword: rains
# [INFO]  Found 7 fonts:
# [INFO]   1. JetBrains Mono
# [INFO]   2. Noto Serif Balinese
# [INFO]   3. Noto Traditional Nushu
# [INFO]   4. Racing Sans One
# [INFO]   5. Saira Semi Condensed
# [INFO]  ... and 2 more results

Download and install font

Usage

Usage: ggfonts install [options] <name>

Arguments:
  name        exact font name.

Options:
  -h, --help  display help for command

Example

ggfonts install 'Open Sans'

# Suggest the font name based on the input if no font matches
ggfonts install fira

# OUTPUT:
# [WARN]  No font found with name: fira
# [INFO]  Search font by keyword: fira
# [INFO]  Found 13 fonts:
# [INFO]   1. Finger Paint
# [INFO]   2. Fira Code
# [INFO]   3. Fira Mono
# [INFO]   4. Fira Sans
# [INFO]   5. Fira Sans Condensed
# [INFO]   6. Fira Sans Extra Condensed
# [INFO]   7. Flow Circular
# [INFO]   8. Fontdiner Swanky
# [INFO]   9. Fredericka the Great
# [INFO]  10. Noto Kufi Arabic
# [INFO]  ... and 3 more results

Supported OS

  • Linux: Debian-based OS, Arch-based OS, CentOS, Alpine, Fedora
  • macOS
  • Windows

ggfonts configuration directory

  • Linux: $HOME/.ggfonts
  • macOS: $HOME/.ggfonts
  • Windows: %LOCALAPPDATA%\ggfonts

Font download location

  • Linux: $HOME/Downloads
  • macOS: $HOME/Downloads
  • Windows: %USERPROFILE%\Downloads

Font install location

  • Linux
    • Debian-based OS: $HOME/.local/share/fonts
    • Arch-based OS: $HOME/.local/share/fonts
    • CentOS: $HOME/.fonts
    • Alpine: $HOME/.fonts
    • Fedora: /usr/share/fonts/[Font Name]
  • macOS: $HOME/Library/Fonts
  • Windows: %WINDIR%\Fonts

Credit

ggfonts wouldn't be possible without using the following modules:

License

Licensed under MIT