Download google fonts and write html/css file with updated path
$ npm install --save google-font-import
gf-import ./fixture/roboto.html --html=./.tmp --font=./.tmp/fonts --style=./.tmp
- --html: html path to save the file having new path of style
- --fonts: destination path to download fonts
- --style: stylesheet path to save the file having new path of fonts
var imports = require("google-font-import");
var opts = {
src: './fixture/roboto.html',
htmlpath: './.tmp',
fontpath: './.tmp/fonts',
stylepath: './.tmp'
};
imports(opts).then(function () {
console.log('done')
});
Required
The path of source html file having stylesheet of google fonts.
Required
html path to save a new html file having new path of stylesheet.
The path for destination to download fonts, If it is not given it will be replaced by htmlpath.
The path for stylesheet to save the file having new path of fonts. If it is not given it will be replaced by htmlpath.
MIT © Jimmy Moon