Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

get-system-fonts

princjef396.1kMIT2.0.2TypeScript support: included

List full paths to all system fonts

font, system, ttf, otf, file

readme

get-system-fonts

Travis CI build status codecov npm version

List full paths to all of the system fonts present.

npm install get-system-fonts

Usage

const getSystemFonts = require('get-system-fonts');

// In an async function...
const files = await getSystemFonts(); // ['/Library/Fonts/Georgia.ttf', ...]

API

getSystemFonts([options]): Promise<string[]>

Lists absolute paths to all system fonts

NOTE: If you're using Typescript, getSystemFonts() is available as the default export.

Params

  • options [object] - Options for configuring retrieval
    • additionalFolders [string[]] - Paths to additional folders to recursively scan for font files. Absolute paths are recommended. Default: []
    • extensions [string[]] - List of file extensions to treat as font files. Default: ['ttf', 'otf', 'ttc', 'woff', 'woff2']

Contributing

Want to contribute to the project? Go check out the Contribution Guide for instructions to set up your development environment, open an issue and create a pull request.

changelog

2.0.2 (2020-06-12)

Bug Fixes

  • no: add option to regexp ignoreCase (#8) (0b3271f)

2.0.1 (2019-04-23)

Bug Fixes

  • windows: include fonts installed to local app data on windows (#4) (95183eb), closes #3

2.0.0 (2018-07-30)

Performance Improvements

  • remove fast-glob dependency to reduce install size (f033af5)

BREAKING CHANGES

  • dropped support for Node 6 and 7