node package manager


A parser for the CSS font value

A simple parser for parsing CSS font values in JavaScript.

If you are using Node.js you can install the parser using:

$ npm install css-font-parser

If you are using an AMD loader you can include the src/parser.js directly into your project.

> var parse = require('css-font-parser');
> parse('15px sans-serif');

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

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

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

Licensed under the three-clause BSD license.