font-query
v2.1.0
Published
font-query is a Node.js package for query the fonts available on your system.
Downloads
39
Maintainers
Readme
font-query
font-query is a Node.js package for query the fonts available on your system.
Current version support Windows and Linux
Install
npm install 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 name and relative path of 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])