Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-font-parser

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-font-parser

A parser for the CSS font value

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
increased by7.75%
Maintainers
0
Weekly downloads
 
Created
Source

CSS font value parser

A simple parser for parsing CSS font values in JavaScript. It has a parser for the font shorthand syntax and the font-family syntax.

Installation

You can install the parser using:

npm install css-font-parser

Usage

import { parseFont, parseFontFamily } from 'css-font-parser';

parseFont('15px sans-serif');

> {
>   'font-family': ['sans-serif'],
>   'font-size': '15px'
> }

parseFont('15px/18px "Neue Helvetica", Helvetica, sans-serif');

> {
>   'font-family': ['Neue Helvetica', 'Helvetica', 'sans-serif'],
>   'font-size': '15px',
>   'line-height': '18px'
> }

parseFontFamily('"Neue Helvetica", Helvetica, system-ui, sans-serif');

> ['Neue Helvetica', 'Helvetica', 'system-ui', 'sans-serif']

License

Licensed under the three-clause BSD license.

Keywords

FAQs

Package last updated on 01 Oct 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc