Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 2.04 KB

README.md

File metadata and controls

57 lines (40 loc) · 2.04 KB

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.