Skip to content

Latest commit

 

History

52 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Font Query

font-query is a Node.js package for querying the fonts available on your system and returning their names and paths.

Socket Badge NPM Version NPM Install Size NPM Downloads License

Current version support Windows and Linux

Install

npm install font-query

Alternatively, if you wish to use font-query as a command-line tool:

npm install -g font-query

Usage

Synchronous

const {fontQuery} = require('font-query');

let myFont = fontQuery('Bal');

console.log(myFont);

Asynchronous

const {fontQueryAsync} = require('font-query');

let myFont = fontQueryAsync('Bal');

myFont.then(fonts => {
   console.log(fonts)
  })
  .catch(err => {
   console.log(err)
 })

The return value of fonts is an array with the name and relative path of the query request

  [
      [
        'Baloo (TrueType)',
        'C:\\Users\\omen\\AppData\\Local\\Microsoft\\Windows\\Fonts\\Baloo-Regular.ttf'
      ]
  ]

License

MIT License - Copyright 2021 Salvatore Santagati (mailto:[email protected])

About

font-query is a Node.js package for query the fonts available on your system.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages