added bin/make-font-list.js.
This commit is contained in:
Родитель
f78d1e6705
Коммит
b51e74a62b
|
@ -0,0 +1 @@
|
|||
node_modules
|
|
@ -0,0 +1,18 @@
|
|||
var request = require('request');
|
||||
var fs = require('fs');
|
||||
|
||||
var API_KEY = "AIzaSyDHYyoV3LUqIuJHGU1dn_QRMcCZUrnrn9o";
|
||||
var URL = "https://www.googleapis.com/webfonts/v1/webfonts?key=" +
|
||||
API_KEY;
|
||||
var ROOT_DIR = __dirname + '/..';
|
||||
var FILENAME = "src/fonts/font-list.json";
|
||||
|
||||
request(URL, function(err, body) {
|
||||
if (err) throw err;
|
||||
var fonts = {};
|
||||
var fontList = JSON.parse(body.body).items.map(function(font) {
|
||||
return font.family;
|
||||
});
|
||||
fs.writeFileSync(ROOT_DIR + '/' + FILENAME, JSON.stringify(fontList));
|
||||
console.log("Wrote " + FILENAME + ".");
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "sticker-fun",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"dependencies": {
|
||||
"request": "~2.51.0"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
Загрузка…
Ссылка в новой задаче