Skip to content

Instantly share code, notes, and snippets.

@araffin
Created November 3, 2022 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save araffin/d7bc83f69f0f720ee191e9fa18919a77 to your computer and use it in GitHub Desktop.
Save araffin/d7bc83f69f0f720ee191e9fa18919a77 to your computer and use it in GitHub Desktop.
Download Google fonts locally
// https://github.com/datalogix/google-fonts-helper
// npm install google-fonts-helper
import { download } from 'google-fonts-helper'
const downloader = download('https://fonts.googleapis.com/css?family=Montserrat:400,700%7CRoboto:400,400italic,700%7CRoboto+Mono&display=swap', {
base64: false,
overwriting: false,
outputDir: './',
stylePath: 'fonts.css',
fontsDir: 'fonts',
fontsPath: './fonts'
})
downloader.execute()
console.log("done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment