Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
font-finder
Advanced tools
Quickly find system font names and metadata without native dependencies.
npm install font-finder
const fontFinder = require('font-finder');
(async () => {
console.log(await fontFinder.list());
// {
// Calibri: [
// {
// path: 'C:/WINDOWS/Fonts/calibri.ttf',
// type: 'sansSerif',
// weight: 400,
// style: 'regular'
// },
// {
// path: 'C:/WINDOWS/Fonts/calibrii.ttf',
// type: 'sansSerif',
// weight: 400,
// style: 'italic'
// },
// ...
// ],
// 'Courier New': [
// {
// path: 'C:/WINDOWS/Fonts/courbi.ttf',
// type: 'monospace',
// weight: 700,
// style: 'boldItalic'
// },
// ...
// ],
// ...
// }
console.log(await fontFinder.listVariants('Calibri'));
// [
// {
// path: 'C:/WINDOWS/Fonts/calibri.ttf',
// type: 'sansSerif',
// weight: 400,
// style: 'regular'
// },
// {
// path: 'C:/WINDOWS/Fonts/calibrii.ttf',
// type: 'sansSerif',
// weight: 400,
// style: 'italic'
// },
// ...
// ]
console.log(await fontFinder.get('C:/WINDOWS/Fonts/calibri.ttf'));
// {
// name: 'Calibri',
// path: 'C:/WINDOWS/Fonts/calibri.ttf',
// type: 'sansSerif',
// weight: 400,
// style: 'regular'
// }
})();
list([options])
Lists all fonts present on the system, grouped by font name. Currently limited to ttf and otf fonts. Returns an object where the keys are the font family names and the values are arrays of metadata for each font variant.
Params
options
[object] - Options for configuring font retrieval
language
[string] - The language to use when fetching font naming
information. Default: 'en'concurrency
[string[]] - Maximum number of fonts to process
concurently. You can tweak this to get the maximum performance out of the
call. Default: 4listVariants(name, [options])
Lists all variants found for the provided font family. The format of each
variant is the same as for each variant in the list()
call. If no variants are
found, an empty array is returned.
Params
name
[string] - The font family name to search foroptions
[object] - Same as for list()
get(path, [options])
Gets metadata for a single font file, returning metadata for the first font
variant found in the file. If there is an error extracting the font, an error is
thrown (unlike in list, where the font is simply ignored). Returns data for a
single font variant. The format is the same as for a single variant in list()
and listVariants()
, but also includes the font's name.
path
[string] - Absolute path to the font file to parseoptions
[object] - Options for configuring font retrieval
language
[string] - The language to use when fetching font naming
information. Default: 'en'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.
FAQs
Quickly find system font names and metadata without native dependencies
The npm package font-finder receives a total of 6,317 weekly downloads. As such, font-finder popularity was classified as popular.
We found that font-finder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.