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

node-fontdump

v4.0.0

Published

cache font files locally and generate a stylesheet for it

Downloads

94

Readme

fontdump

fontdump is a node module and command line program that processes stylesheets for @font-face rules, downloads the fonts and saves them locally. The resulting fontdump stylesheet uses the good ol' 'bulletproof' @font-face declaration syntax and includes unicode-range and font-display properties if provided by the source.

Since version 3.0 only woff and woff2 files are downloaded by default. If you want to download legacy web font formats like eot, ttf, or svg pass the --include-legacy-formats option.

fontdump is primarily written for and used with Google Fonts.

If you often find yourself:

  • downloading fonts for local development
  • wondering about privacy

when using Google Fonts or similar services you may find fontdump useful.

Installation

Install via npm/yarn:

# via npm
npm install node-fontdump
# via yarn
yarn add node-fontdump

Usage

Command Line Interface

fontdump comes with a simple cli.

Just pass a stylesheet URL:

bin/fontdump.js "http://fonts.googleapis.com/css?family=Roboto:300"

There are a few options to configure the behaviour of fontdump. Run bin/fontdump.js --help to see them. You can change the output directory, add a base path and increase the verbosity level in case of errors.

API

You may also use the fontdump API. The fontdump module exposes a function that returns a Promise and accepts a config object.

You may pass the following options:

logger: a logger instance (uses console by default, but this might be very verbose)

You must pass the following options:

url: the URL to the stylesheet

targetDirectory: the directory font and css files should be saved to

webDirectory: the path that should be prepended to the font file URL.

includeLegacyFormats: when truthy fontdump will download legacy formats like EOT, SVG, and TTF.

License

Licensed under the terms of the ISC license. See the LICENSE file.