Skip to content

archoleat/validate-font-file-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Validate Font File Name

NPM Version NPM Downloads ESM Provenance CodeQL Specs Commitlint Editorconfig Prettier ESLint Remark

Table of Contents

Installation

bun i -D @archoleat/validate-font-file-name

Usage

Naming Convention

The font family and font weight must be in Pascal Case and separated by a hyphen.

Extensions that are allowed: otf, ttf, woff, woff2.

Example: OpenSans-SemiBold.woff2.

It's not necessary to specify the regex parameter.

import { validateFontFileName } from '@archoleat/validate-font-file-name';

await validateFontFileName({
  file: 'path/to/file',
  regex: /regex/ | new RegExp() | '',
});

Contributing

Please read CONTRIBUTING to start contributing.

License

This project is licensed under the MIT license.