Skip to content

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

License

Notifications You must be signed in to change notification settings

salsan/font-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:me@salsan.dev)

About

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

Topics

Resources

License

Stars

Watchers

Forks