Skip to content

Commit 37c641c

Browse files
Tin SeverTin Sever
authored andcommitted
remove api key since not needed
1 parent 1d3dae4 commit 37c641c

File tree

1 file changed

+15
-31
lines changed

1 file changed

+15
-31
lines changed

README.md

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Google Font CLI
22
=============
33

4+
> This tool uses [google-webfonts-helper](https://gwfh.mranftl.com/) to access Google Fonts without requiring an API key.
45
56
Google Font CLI is a NodeJS module/CLI that lets you Search, Download and Install fonts offered by Google Web Fonts.
67

@@ -138,19 +139,12 @@ And then you can require it in your code:
138139
var GoogleFontList = require('google-font-cli');
139140
```
140141

141-
To use this API is necessary to obtain a Browser Key enabled to Google Font API from the [Google Developer Dashboard](https://console.developers.google.com/).
142-
143142
### GoogleFontList
144143

145-
**GoogleFontList** is a class that can be instanced with the Google API Key as only argument.
146-
```js
147-
var fontList = new GoogleFontList('API_KEY');
148-
```
149-
If you prefer you can also create an instance without the apiKey and call the methods `.setApiKey('API_KEY')` and `.downloadList()` in a second moment.
144+
**GoogleFontList** is a class that downloads the font list from google-webfonts-helper.
150145
```js
146+
var GoogleFontList = require('google-font-cli');
151147
var fontList = new GoogleFontList();
152-
fontList.setApiKey('API_KEY');
153-
fontList.downloadList();
154148
```
155149
<a id="google-font-list-events"></a>
156150

@@ -163,9 +157,7 @@ Emitter if something go wrong in downloading, coverting or processing data. The
163157
<a id="google-font-list-properties"></a>
164158
#### Public properties
165159
###### `data` [Array]
166-
Array of GoogleFont instances, a class that extends the data provided by the Google APIs. Empty until 'success' event.
167-
###### `apiKey` [String]
168-
The Google APIs Key setted with the constructor or with setApiKey().
160+
Array of GoogleFont instances, a class that extends the data provided by google-webfonts-helper. Empty until 'success' event.
169161

170162
<a id="google-font-list-methods"></a>
171163
#### Public methods
@@ -175,22 +167,16 @@ The Google APIs Key setted with the constructor or with setApiKey().
175167
- Returns [String|Boolean] If apiKey is a valid string, return the apiKey trimmed, else returns false.
176168

177169
Used to set the apiKey to download data from Google Web Font APIs.
178-
179-
###### `downloadList()`
180-
Download the list from Google Web Font APIs.
181-
182-
###### `parseRawData(rawData)`
183-
- _rawData_ [String] String in valid JSON format.
184-
185-
Parse raw data in valid JSON format. Used internally, but public for convenience if someone prefers to use the object without downloading the list (ex. cached data).
170+
downloadList()`
171+
Download the list from google-webfonts-helpernternally, but public for convenience if someone prefers to use the object without downloading the list (ex. cached data).
186172

187173
###### `populate(jsonData)`
188174
- _jsonData_ [Array] An array of Object rappresenting the font like Google does.
189175

190-
Populate the object `data` property with an array of GoogleFont instances, based on the data provided by Google Apis. Used internally, but public for convenience if someone prefers to use the object without downloading and parsing the list (ex. cached data).
176+
Populate the object `data` property with an array of GoogleFontfrom google-webfonts-helper.
191177

192-
###### `clone()`
193-
- Returns [GoogleFontList] A new instance of GoogleFontList
178+
Populate the object `data` property with an array of GoogleFont instances, based on the data provided by google-webfonts-helper
179+
- Returns [GoogleFontList] A new in from google-webfonts-helperstance of GoogleFontList
194180

195181
Return a new instance of the object, with the same `data` and `apiKey` properties.
196182

@@ -259,21 +245,21 @@ It's instanced by the populate method of GoogleFontList, called internally by th
259245
###### `family` `category` `version` `lastModified` [String]
260246
Inherits by Google Font API structure, respectively the font name, the font type (serif, sans-serif, etc), the version and the string rappresenting the last modification data.
261247
###### `subsets` [Array]
262-
Inherits by Google Font API structure, a list of the available subsest for that font.
248+
Inherits by google-webfonts-helper data structure, respectively the font name, the font type (serif, sans-serif, etc), the version and the string rappresenting the last modification data.
249+
###### `subsets` [Array]
250+
Inherits by google-webfonts-helper data structure, a list of the available subsest for that font.
263251
###### `variants` [Array]
264-
Inherits by Google Font API structure, a list of all available variants (weights) for that font.
252+
Inherits by google-webfonts-helper data structure, a list of all available variants (weights) for that font.
265253
###### `files` [Object]
266-
Inherits by Google Font API structure, an object with key-value of variant and ttf remote file.
267-
###### `cssUrl` [String]
268-
Url of the css file containing the ready-to-use imports for the web about that specific font.
254+
Inherits by google-webfonts-helper dataing the ready-to-use imports for the web about that specific font.
269255

270256
<a id="google-font-methods"></a>
271257
#### Public methods
272258

273259
###### `getFamily()` `getCategory()` `getVariants()` `getSubsets()` `getVersion()` `getLastMod()` `getFileList()` `getCssUrl()`
274260
Method to access to the public properties: it's a better idea use them insteed the properties for a future-proof reason. Maybe someday google will decide to changhe his properties names.
275261
All returns the type of the property, except `GetLastMod()` that return a new Date instance.
276-
262+
ad of the properties for a future-proof reason. Maybe someday the data structure will change
277263
##### `hasVariant(variant)`
278264
- variant [String] The name of a variant (300, 500, etc);
279265
- Returns [Boolean] true if the font has that variant, else returns false.
@@ -321,8 +307,6 @@ Install specified variants of the font. The destination folder depends on the pl
321307
```js
322308
var GoogleFontlist = require('google-font-cli');
323309

324-
var fontList = new GoogleFontlist('VALID_API_KEY');
325-
326310
fontList.on('success', function(){
327311
this.searchFontByName('Source Sans Pro', function(err, filteredList) {
328312
if (err)

0 commit comments

Comments
 (0)