Nobody Prefers Margarine
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

serve-fontmin

0.1.3 • Public • Published

serve-fontmin

Build Status NPM version Downloads Dependencies Coverage Status

fontmin serving middleware

Usage

server

var express = require('express');
var fontmin = require('serve-fontmin');
var app = express();
 
app.use('/static', fontmin('public/font'));
 
var server = app.listen(8090, function () {
  var host = server.address().address;
  var port = server.address().port;
 
  console.log('Example app listening at http://%s:%s', host, port);
});
 

browser

basic

${pathname}/${filename}.css?text=${text}

optional font-family

${pathname}/${filename}.css?text=${text}&name=${fontFamily}

API

fontmin(path, [options])

Path:

source font path.

Options:

  • headers headers of response to serve, optional.
  • oppressor compression response, defaults false.
  • base64 inject base64 data:application/x-font-ttf; (gzip font with css). defaults false
  • storage storage plugin, if you want to use a Storage Service like AWS, BOS instead fs, optional.

Example

cd example
$ npm i
$ node app.js

open http://127.0.0.1:8090/index.html

Related

License

MIT © fontmin

install

npm i serve-fontmin

Downloadsweekly downloads

9

version

0.1.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability