Installations
npm install css-font-face-src
Developer Guide
Typescript
Yes
Module System
CommonJS, UMD
Node Version
16.13.2
NPM Version
8.1.2
Score
92.1
Supply Chain
99.6
Quality
75.6
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (97.59%)
JavaScript (2.41%)
Developer
cburgmer
Download Statistics
Total Downloads
2,017,136
Last Day
2,463
Last Week
10,165
Last Month
44,597
Last Year
558,824
GitHub Statistics
8 Stars
48 Commits
3 Forks
2 Watching
2 Branches
3 Contributors
Bundle Size
7.30 kB
Minified
2.85 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.0.0
Package Id
css-font-face-src@2.0.0
Unpacked Size
99.45 kB
Size
14.19 kB
File Count
29
NPM Version
8.1.2
Node Version
16.13.2
Publised On
24 Jan 2024
Total Downloads
Cumulative downloads
Total Downloads
2,017,136
Last day
10.2%
2,463
Compared to previous day
Last week
-13.6%
10,165
Compared to previous week
Last month
15.3%
44,597
Compared to previous month
Last year
48.9%
558,824
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
CSS @font-face
rule src
field parser – css-font-face-src
A CSS @font-face src
property value parser.
Basically it provides two operations:
parse
: To convert a CSS property string to an array of easily readable objects. Each object either describes a local font (referenced using its family name) or a remote font (referenced using its URL).serialize
: To convert an object array back to a CSS property string.
Examples
JavaScript verison (CJS, using require
)
Parse
1const parser = require('css-font-face-src'); 2 3console.log(parser.parse('local("The Font"), url("font.otf") format("opentype"), url("font.woff"), local("Another Font")'));
will return:
1[ 2 { local: 'The Font' }, 3 { url: 'font.otf', format: 'opentype' }, 4 { url: 'font.woff' }, 5 { local: 'Another Font' } 6]
Serialize
1const parser = require('css-font-face-src'); 2 3console.log( 4 parser.serialize([ 5 { local: 'The Font' }, 6 { url: 'font.otf', format: 'opentype' }, 7 { url: 'font.woff' }, 8 { local: 'Another Font' } 9 ]) 10);
will return:
1'local("The Font"), url("font.otf") format("opentype"), url("font.woff"), local("Another Font")'
JavaScript version (ESM, using import
)
Parse
1import { parse } from 'css-font-face-src'; 2 3console.log(parse('local("The Font"), url("font.otf") format("opentype"), url("font.woff"), local("Another Font")'));
will return:
1[ 2 { local: 'The Font' }, 3 { url: 'font.otf', format: 'opentype' }, 4 { url: 'font.woff' }, 5 { local: 'Another Font' } 6]
Serialize
1import { serialize } from 'css-font-face-src'; 2 3console.log( 4 serialize([ 5 { local: 'The Font' }, 6 { url: 'font.otf', format: 'opentype' }, 7 { url: 'font.woff' }, 8 { local: 'Another Font' } 9 ]) 10);
will return:
1'local("The Font"), url("font.otf") format("opentype"), url("font.woff"), local("Another Font")'
TypeScript version
Parse
1import { parse } from 'css-font-face-src'; 2 3console.log(parse('local("The Font"), url("font.otf") format("opentype"), url("font.woff"), local("Another Font")'));
will return:
1[ 2 { local: 'The Font' }, 3 { url: 'font.otf', format: 'opentype' }, 4 { url: 'font.woff' }, 5 { local: 'Another Font' } 6]
Serialize
1import { serialize, FontFaceSrcItem } from 'css-font-face-src'; 2 3console.log( 4 serialize([ 5 { local: 'The Font' }, 6 { url: 'font.otf', format: 'opentype' }, 7 { url: 'font.woff' }, 8 { local: 'Another Font' } 9 ] as FontFaceSrcItem[]) 10);
will return:
1'local("The Font"), url("font.otf") format("opentype"), url("font.woff"), local("Another Font")'
Build status
Author
Christoph Burgmer. Licensed under BSD-2-Clause. Reach out on Twitter.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 2/17 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 16 are checked with a SAST tool
Reason
12 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
1.4
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More