0.5.1 • Published 1 year ago

@joncasey/google-fonts v0.5.1

Weekly downloads
20
License
MIT
Repository
github
Last release
1 year ago

google-fonts

Download fonts for local/offline delivery.

Install

npm i @joncasey/google-fonts

Example

const { getFont, downloadFont } = require('@joncasey/google-fonts')

getFont('Open Sans')
.then(font => downloadFont(font, 'Open Sans'))
.then(results => console.log(results))
.catch(error => console.log(`Error`, error))

Advanced Usage!

You can just copy the dist files locally. They have ZERO-dependencies (other than NodeJS)

copy https://unpkg.com/@joncasey/google-fonts/dist/google-fonts.mjs Then just

import { getFont, downloadFont } from './google-fonts.mjs'

or, using require..

copy https://unpkg.com/@joncasey/google-fonts/dist/google-fonts.js

const { getFont, downloadFont } = require('./google-fonts.js')

API

let fontObject = await getFont (fontFamily)

/*
  fontObject = {
    css: "",
    fonts: [
      {
        src: {
          local: "",
          woff: "",
          woff2: ""
        },
        family: "",
        style: "",
        weight: ""
      }
    ],
    raw: []
  }
*/
0.5.1

1 year ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago