webfont-awesome-pro 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/css/allstyles.css +29 -29
- package/dist/fapro.d.ts.map +1 -1
- package/dist/index.cjs +27 -35
- package/dist/index.cjs.map +1 -1
- package/dist/module.mjs +23 -31
- package/dist/module.mjs.map +1 -1
- package/dist/scss/allstyles.scss +1 -1
- package/dist/scss/brands.scss +1 -1
- package/dist/scss/chisel-regular.scss +1 -1
- package/dist/scss/duotone-light.scss +1 -1
- package/dist/scss/duotone-regular.scss +1 -1
- package/dist/scss/duotone-thin.scss +1 -1
- package/dist/scss/duotone.scss +1 -1
- package/dist/scss/etch-solid.scss +1 -1
- package/dist/scss/fontawesome.scss +1 -1
- package/dist/scss/jelly-duo-regular.scss +1 -1
- package/dist/scss/jelly-fill-regular.scss +1 -1
- package/dist/scss/jelly-regular.scss +1 -1
- package/dist/scss/light.scss +1 -1
- package/dist/scss/notdog-duo-solid.scss +1 -1
- package/dist/scss/notdog-solid.scss +1 -1
- package/dist/scss/regular.scss +1 -1
- package/dist/scss/sharp-duotone-light.scss +1 -1
- package/dist/scss/sharp-duotone-regular.scss +1 -1
- package/dist/scss/sharp-duotone-solid.scss +1 -1
- package/dist/scss/sharp-duotone-thin.scss +1 -1
- package/dist/scss/sharp-light.scss +1 -1
- package/dist/scss/sharp-regular.scss +1 -1
- package/dist/scss/sharp-solid.scss +1 -1
- package/dist/scss/sharp-thin.scss +1 -1
- package/dist/scss/slab-press-regular.scss +1 -1
- package/dist/scss/slab-regular.scss +1 -1
- package/dist/scss/solid.scss +1 -1
- package/dist/scss/thin.scss +1 -1
- package/dist/scss/thumbprint-light.scss +1 -1
- package/dist/scss/whiteboard-semibold.scss +1 -1
- package/dist/webfapro.js +1 -1
- package/dist/webfapro.js.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
package/dist/css/allstyles.css
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
@import "
|
|
2
|
-
@import "
|
|
3
|
-
@import "
|
|
4
|
-
@import "
|
|
5
|
-
@import "
|
|
6
|
-
@import "
|
|
7
|
-
@import "
|
|
8
|
-
@import "
|
|
9
|
-
@import "
|
|
10
|
-
@import "
|
|
11
|
-
@import "
|
|
12
|
-
@import "
|
|
13
|
-
@import "
|
|
14
|
-
@import "
|
|
15
|
-
@import "
|
|
16
|
-
@import "
|
|
17
|
-
@import "
|
|
18
|
-
@import "
|
|
19
|
-
@import "
|
|
20
|
-
@import "
|
|
21
|
-
@import "
|
|
22
|
-
@import "
|
|
23
|
-
@import "
|
|
24
|
-
@import "
|
|
25
|
-
@import "
|
|
26
|
-
@import "
|
|
27
|
-
@import "
|
|
28
|
-
@import "
|
|
29
|
-
@import "
|
|
1
|
+
@import "webfont-awesome-pro/css/fontawesome.css";
|
|
2
|
+
@import "webfont-awesome-pro/css/whiteboard-semibold.css";
|
|
3
|
+
@import "webfont-awesome-pro/css/thumbprint-light.css";
|
|
4
|
+
@import "webfont-awesome-pro/css/slab-press-regular.css";
|
|
5
|
+
@import "webfont-awesome-pro/css/slab-regular.css";
|
|
6
|
+
@import "webfont-awesome-pro/css/sharp-duotone-thin.css";
|
|
7
|
+
@import "webfont-awesome-pro/css/sharp-duotone-solid.css";
|
|
8
|
+
@import "webfont-awesome-pro/css/sharp-duotone-regular.css";
|
|
9
|
+
@import "webfont-awesome-pro/css/sharp-duotone-light.css";
|
|
10
|
+
@import "webfont-awesome-pro/css/sharp-thin.css";
|
|
11
|
+
@import "webfont-awesome-pro/css/sharp-solid.css";
|
|
12
|
+
@import "webfont-awesome-pro/css/sharp-regular.css";
|
|
13
|
+
@import "webfont-awesome-pro/css/sharp-light.css";
|
|
14
|
+
@import "webfont-awesome-pro/css/notdog-duo-solid.css";
|
|
15
|
+
@import "webfont-awesome-pro/css/notdog-solid.css";
|
|
16
|
+
@import "webfont-awesome-pro/css/jelly-fill-regular.css";
|
|
17
|
+
@import "webfont-awesome-pro/css/jelly-duo-regular.css";
|
|
18
|
+
@import "webfont-awesome-pro/css/jelly-regular.css";
|
|
19
|
+
@import "webfont-awesome-pro/css/etch-solid.css";
|
|
20
|
+
@import "webfont-awesome-pro/css/duotone-thin.css";
|
|
21
|
+
@import "webfont-awesome-pro/css/duotone.css";
|
|
22
|
+
@import "webfont-awesome-pro/css/duotone-regular.css";
|
|
23
|
+
@import "webfont-awesome-pro/css/duotone-light.css";
|
|
24
|
+
@import "webfont-awesome-pro/css/thin.css";
|
|
25
|
+
@import "webfont-awesome-pro/css/solid.css";
|
|
26
|
+
@import "webfont-awesome-pro/css/regular.css";
|
|
27
|
+
@import "webfont-awesome-pro/css/light.css";
|
|
28
|
+
@import "webfont-awesome-pro/css/brands.css";
|
|
29
|
+
@import "webfont-awesome-pro/css/chisel-regular.css";
|
package/dist/fapro.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AWyBA,qCAAqC,IAAI,CAExC;AACD,4BAA4B,IAAI,CAE/B","sources":["src/src/helper/waittime.ts","src/src/main/question.ts","src/src/pages/askQuestions.ts","src/src/main/dir-checker.ts","src/src/main/file-downloader.ts","src/src/pages/cssDownload.ts","src/src/main/font-extractor.ts","src/src/pages/fontsDownload.ts","src/src/pages/fa.types.ts","src/src/pages/versionCheck.ts","src/src/pages/noticeOfficial.ts","src/src/index.ts","src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,"import waittime from \"./helper/waittime\"\nimport askQuestion from \"./pages/askQuestions\"\nimport cssDownload from \"./pages/cssDownload\"\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\nimport checkVersion from \"./pages/versionCheck\"\nimport unofficialNotice from \"./pages/noticeOfficial\"\n\nasync function startDownloader(): Promise<void> {\n await waittime(100)\n console.clear()\n const { isOk } = await unofficialNotice()\n if (!isOk) return\n const { useDir } = await askQuestion()\n const { fontlist, useVer, baseUrl } = await checkVersion()\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\n await downloadFonts(fontUrls, useDir, baseUrl)\n await waittime(1000)\n console.log(\"--------\")\n await waittime(1000)\n console.log(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`)\n await waittime(1000)\n console.log(\"DONE\")\n await waittime(1000)\n}\nexport function getFontAwesomePro(): void {\n startDownloader()\n}\nexport function getFapro(): void {\n startDownloader()\n}\n"],"names":[],"version":3,"file":"fapro.d.ts.map","sourceRoot":"../"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var $cl6Iw$chalk = require("chalk");
|
|
2
1
|
var $cl6Iw$readline = require("readline");
|
|
3
2
|
var $cl6Iw$nodejsfiledownloader = require("nodejs-file-downloader");
|
|
4
3
|
var $cl6Iw$fs = require("fs");
|
|
@@ -6,24 +5,22 @@ var $cl6Iw$postcss = require("postcss");
|
|
|
6
5
|
var $cl6Iw$postcsssafeparser = require("postcss-safe-parser");
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
function $parcel$interopDefault(a) {
|
|
10
|
-
return a && a.__esModule ? a.default : a;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
8
|
function $parcel$export(e, n, v, s) {
|
|
14
9
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
10
|
}
|
|
16
11
|
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
|
|
17
16
|
$parcel$export(module.exports, "getFontAwesomePro", () => $123f4982a51872b4$export$c0a0c3a161860b55);
|
|
18
17
|
$parcel$export(module.exports, "getFapro", () => $123f4982a51872b4$export$89ae034f08762d55);
|
|
19
|
-
|
|
20
18
|
function $4335f2725be7a2e4$export$2e2bcd8739ae039(ms = 500, n = 5) {
|
|
21
19
|
return new Promise((resolve)=>setTimeout(resolve, ms - n));
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
|
|
26
|
-
|
|
27
24
|
function $fd2fccb6528f1018$export$db9f06b5d27d15d8(text) {
|
|
28
25
|
return new Promise((resolve)=>{
|
|
29
26
|
const rl = (0, ($parcel$interopDefault($cl6Iw$readline))).createInterface({
|
|
@@ -44,24 +41,24 @@ async function $1be43886ff9389d9$export$2e2bcd8739ae039() {
|
|
|
44
41
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
45
42
|
console.log(" ");
|
|
46
43
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
47
|
-
console.log(`Set the
|
|
44
|
+
console.log(`Set the Download Path!`);
|
|
48
45
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
49
46
|
console.log("--------");
|
|
50
47
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
51
|
-
console.log("Download path can be
|
|
48
|
+
console.log("Download path can be `path/to/your/public/folder` or `anything`.");
|
|
52
49
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
53
50
|
console.log("--------");
|
|
54
51
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
55
52
|
console.log("if the path does not exist, it will be created automatically.");
|
|
56
53
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(500);
|
|
57
54
|
console.log("--------");
|
|
58
|
-
const dir = await (0, $fd2fccb6528f1018$export$db9f06b5d27d15d8)(`Enter download path:
|
|
55
|
+
const dir = await (0, $fd2fccb6528f1018$export$db9f06b5d27d15d8)(`Enter download path: (fapro) `);
|
|
59
56
|
const useDir = dir ? dir : "fapro";
|
|
60
|
-
console.log(
|
|
57
|
+
console.log(`${useDir}${dir ? "" : " (default)"}`);
|
|
61
58
|
console.log("--------");
|
|
62
59
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(750);
|
|
63
60
|
console.log(" ");
|
|
64
|
-
console.log(
|
|
61
|
+
console.log("Preparing Downloader");
|
|
65
62
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2250);
|
|
66
63
|
console.log(" ");
|
|
67
64
|
return {
|
|
@@ -73,7 +70,6 @@ async function $1be43886ff9389d9$export$2e2bcd8739ae039() {
|
|
|
73
70
|
|
|
74
71
|
|
|
75
72
|
|
|
76
|
-
|
|
77
73
|
async function $c3e5cd03b3c41221$export$75ad550fa5fe1d36(dirpath) {
|
|
78
74
|
let curpath = ".";
|
|
79
75
|
const dirs = dirpath.split("/");
|
|
@@ -87,7 +83,6 @@ async function $c3e5cd03b3c41221$export$75ad550fa5fe1d36(dirpath) {
|
|
|
87
83
|
}
|
|
88
84
|
|
|
89
85
|
|
|
90
|
-
|
|
91
86
|
let $27d6a850902385a7$var$filesDownloaded = [];
|
|
92
87
|
async function $27d6a850902385a7$export$bb3b75778e3e272(fileurl, filedir, progress = null) {
|
|
93
88
|
await (0, $c3e5cd03b3c41221$export$75ad550fa5fe1d36)(`${filedir}`);
|
|
@@ -100,10 +95,10 @@ async function $27d6a850902385a7$export$bb3b75778e3e272(fileurl, filedir, progre
|
|
|
100
95
|
await downloader.download();
|
|
101
96
|
const fileorigin = fileurl.split("/");
|
|
102
97
|
const filename = fileorigin[fileorigin.length - 1];
|
|
103
|
-
console.log(`\u{1F680} ${progress ?
|
|
98
|
+
console.log(`\u{1F680} ${progress ? progress + " " : ""}${filename}`);
|
|
104
99
|
$27d6a850902385a7$var$filesDownloaded.push(filename);
|
|
105
100
|
} catch (_error) {
|
|
106
|
-
throw new Error(
|
|
101
|
+
throw new Error("The version you wanted to download is not available. Please use other release version.");
|
|
107
102
|
}
|
|
108
103
|
}
|
|
109
104
|
function $27d6a850902385a7$export$8de8b92fd301c83e() {
|
|
@@ -126,7 +121,7 @@ async function $356121e0811cedf1$export$2e2bcd8739ae039(useVer, useDir, fontlist
|
|
|
126
121
|
const progress = `[${i + 1}/${fontlist.length}]`;
|
|
127
122
|
await (0, $27d6a850902385a7$export$bb3b75778e3e272)(url, dir, progress);
|
|
128
123
|
}
|
|
129
|
-
console.log(
|
|
124
|
+
console.log("\u2705 Stylesheets Downloaded");
|
|
130
125
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
131
126
|
return (0, $27d6a850902385a7$export$8de8b92fd301c83e)();
|
|
132
127
|
}
|
|
@@ -165,14 +160,13 @@ function $dee518ee90c6edcc$export$cbcfe4007f417765() {
|
|
|
165
160
|
|
|
166
161
|
|
|
167
162
|
|
|
168
|
-
|
|
169
163
|
async function $7348ac6bfe35f15e$export$ae70b50decb7cf58(sheets, useDir) {
|
|
170
164
|
console.log("--------");
|
|
171
165
|
console.log("\uD83D\uDD57 Reading Available Webfonts");
|
|
172
166
|
const dir = `${useDir}/css`;
|
|
173
167
|
for (const sheet of sheets)await (0, $dee518ee90c6edcc$export$85c953af022fd6f3)(sheet, dir);
|
|
174
168
|
const fonts = (0, $dee518ee90c6edcc$export$cbcfe4007f417765)();
|
|
175
|
-
console.log("\u2705 Found " +
|
|
169
|
+
console.log("\u2705 Found " + fonts.length.toString() + " Webfonts");
|
|
176
170
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
177
171
|
return fonts;
|
|
178
172
|
}
|
|
@@ -189,7 +183,7 @@ async function $7348ac6bfe35f15e$export$6c18a7d4cf131851(fonts, filedir, baseUrl
|
|
|
189
183
|
const progress = `[${i + 1}/${fonts.length}]`;
|
|
190
184
|
await (0, $27d6a850902385a7$export$bb3b75778e3e272)(url, dir, progress);
|
|
191
185
|
}
|
|
192
|
-
console.log(
|
|
186
|
+
console.log("\u2705 Webfonts Downloaded");
|
|
193
187
|
}
|
|
194
188
|
|
|
195
189
|
|
|
@@ -198,7 +192,6 @@ $76e709583c343c63$exports = JSON.parse("{\"version\":\"7.0.0\",\"root\":\"https:
|
|
|
198
192
|
|
|
199
193
|
|
|
200
194
|
|
|
201
|
-
|
|
202
195
|
async function $b5a14f8b420f5894$var$getVersion() {
|
|
203
196
|
const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`;
|
|
204
197
|
return await fetch(url, {
|
|
@@ -221,7 +214,7 @@ async function $b5a14f8b420f5894$export$2e2bcd8739ae039() {
|
|
|
221
214
|
console.log("--------");
|
|
222
215
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
223
216
|
console.log(" ");
|
|
224
|
-
console.log(
|
|
217
|
+
console.log(`Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(".")[0]} Pro Plus`);
|
|
225
218
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
226
219
|
console.log(" ");
|
|
227
220
|
console.log("--------");
|
|
@@ -229,7 +222,7 @@ async function $b5a14f8b420f5894$export$2e2bcd8739ae039() {
|
|
|
229
222
|
console.log("\uD83D\uDD57 Reading Available Stylesheets");
|
|
230
223
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(500);
|
|
231
224
|
const fontlist = curFonts.css.map((file)=>`${curFonts.root}/css/${file}`);
|
|
232
|
-
console.log("\u2705 Found " +
|
|
225
|
+
console.log("\u2705 Found " + fontlist.length.toString() + " Sytlesheets");
|
|
233
226
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
234
227
|
return {
|
|
235
228
|
fontlist: fontlist,
|
|
@@ -241,29 +234,28 @@ async function $b5a14f8b420f5894$export$2e2bcd8739ae039() {
|
|
|
241
234
|
|
|
242
235
|
|
|
243
236
|
|
|
244
|
-
|
|
245
237
|
async function $4eef5e371b281461$export$2e2bcd8739ae039() {
|
|
246
|
-
console.log(
|
|
238
|
+
console.log("Font Awesome Pro Plus Downloader | Devanka761");
|
|
247
239
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(500);
|
|
248
240
|
console.log("");
|
|
249
241
|
console.log("--------");
|
|
250
|
-
console.log(`Font Awesome Pro Plus Downloader was made for
|
|
242
|
+
console.log(`Font Awesome Pro Plus Downloader was made for educational purposes only!`);
|
|
251
243
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
252
244
|
console.log("--------");
|
|
253
245
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
254
|
-
console.log(`This downloader provides
|
|
246
|
+
console.log(`This downloader provides Paid (Pro Plus) Version for the latest Official Package. It is intended for experimental and personal use only. It is licensed for commercial use.`);
|
|
255
247
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
256
248
|
console.log("--------");
|
|
257
249
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
258
|
-
console.log(
|
|
250
|
+
console.log(`DO NOT use this downloader if you are not a Creator or you have never buy the official product from the official website.`);
|
|
259
251
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
260
252
|
console.log("--------");
|
|
261
253
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
262
|
-
console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the
|
|
254
|
+
console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the Font Awesome webiste: https://fontawesome.com/plans`);
|
|
263
255
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
264
256
|
console.log("--------");
|
|
265
257
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(500);
|
|
266
|
-
let agree = await (0, $fd2fccb6528f1018$export$db9f06b5d27d15d8)(`Continue to download? (
|
|
258
|
+
let agree = await (0, $fd2fccb6528f1018$export$db9f06b5d27d15d8)(`Continue to download? (Y/n) `);
|
|
267
259
|
agree = agree ? agree.toLowerCase() : "y";
|
|
268
260
|
const notAgrees = [
|
|
269
261
|
"no",
|
|
@@ -271,13 +263,13 @@ async function $4eef5e371b281461$export$2e2bcd8739ae039() {
|
|
|
271
263
|
"nope"
|
|
272
264
|
];
|
|
273
265
|
const isOk = notAgrees.find((textNo)=>textNo === agree) ? false : true;
|
|
274
|
-
console.log(
|
|
266
|
+
console.log(isOk ? "y" : "n");
|
|
275
267
|
if (!isOk) {
|
|
276
268
|
console.log("--------");
|
|
277
269
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
278
|
-
console.log(
|
|
270
|
+
console.log("\u26D4 Font Awesome Pro Plus Downloader Canceled");
|
|
279
271
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
280
|
-
console.log(
|
|
272
|
+
console.log("DONE");
|
|
281
273
|
}
|
|
282
274
|
return {
|
|
283
275
|
isOk: isOk
|
|
@@ -298,9 +290,9 @@ async function $123f4982a51872b4$var$startDownloader() {
|
|
|
298
290
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
299
291
|
console.log("--------");
|
|
300
292
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
301
|
-
console.log(
|
|
293
|
+
console.log(`\u{2705} Font Awesome ${useVer.split(".")[0]} Pro Plus v${useVer} Downloaded Successfully!`);
|
|
302
294
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
303
|
-
console.log(
|
|
295
|
+
console.log("DONE");
|
|
304
296
|
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
305
297
|
}
|
|
306
298
|
function $123f4982a51872b4$export$c0a0c3a161860b55() {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;ACAe,kDAAkB,KAAa,GAAG,EAAE,IAAY,CAAC;IAC9D,OAAO,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS,KAAK;AAC3D;;;;;AEAO,SAAS,0CAAS,IAAY;IACnC,OAAO,IAAI,QAAQ,CAAC;QAClB,MAAM,KAAK,CAA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C,sBAAe,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,yBAAyB,CAAC;IAC7G,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,CAAA,GAAA,sCAAI,EAAE,OAAO,CAAC,KAAK,CAAC;IAChC,MAAM,CAAA,GAAA,wCAAO,EAAE;AACjB;AACO,SAAS;IACd;AACF;AACO,SAAS;IACd;AACF","sources":["src/index.ts","src/helper/waittime.ts","src/pages/askQuestions.ts","src/main/question.ts","src/pages/cssDownload.ts","src/main/file-downloader.ts","src/main/dir-checker.ts","src/pages/fontsDownload.ts","src/main/font-extractor.ts","src/pages/versionCheck.ts","src/json/fonts.json","src/pages/noticeOfficial.ts"],"sourcesContent":["import chalk from \"chalk\"\nimport waittime from \"./helper/waittime\"\nimport askQuestion from \"./pages/askQuestions\"\nimport cssDownload from \"./pages/cssDownload\"\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\nimport checkVersion from \"./pages/versionCheck\"\nimport unofficialNotice from \"./pages/noticeOfficial\"\n\nasync function startDownloader(): Promise<void> {\n await waittime(100)\n console.clear()\n const { isOk } = await unofficialNotice()\n if (!isOk) return\n const { useDir } = await askQuestion()\n const { fontlist, useVer, baseUrl } = await checkVersion()\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\n await downloadFonts(fontUrls, useDir, baseUrl)\n await waittime(1000)\n console.log(\"--------\")\n await waittime(1000)\n console.log(chalk.green(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`))\n await waittime(1000)\n console.log(chalk.bgGreen.black(\" --- DONE --- \"))\n await waittime(1000)\n}\nexport function getFontAwesomePro(): void {\n startDownloader()\n}\nexport function getFapro(): void {\n startDownloader()\n}\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms - n))\n}\n","import chalk from \"chalk\"\nimport { question } from \"../main/question\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function askQuestion(): Promise<{ useDir: string }> {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n await waittime(100)\n console.log(`Set the ${chalk.cyan(\"Download Path\")}!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"Download path can be \" + chalk.cyan(\"`path/to/your/public/folder`\") + \" or \" + chalk.cyan(\"`anything`\") + \".\")\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"if the path does not exist, it will be created automatically.\")\n await waittime(500)\n console.log(\"--------\")\n const dir = await question(`Enter download path: ${chalk.bold.cyan(\"(fapro)\")} `)\n const useDir = dir ? dir : \"fapro\"\n console.log(chalk.bold.cyan(`${useDir}`) + `${dir ? \"\" : \" (default)\"}`)\n console.log(\"--------\")\n await waittime(750)\n console.log(\" \")\n console.log(chalk.bgYellow.black(\" -- Preparing Downloader -- \"))\n await waittime(2250)\n console.log(\" \")\n return { useDir }\n}\n","import readline from \"readline\"\n\nexport function question(text: string): Promise<string> {\n return new Promise((resolve) => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n rl.question(text, (anwer) => {\n resolve(anwer)\n rl.close()\n })\n })\n}\n","import chalk from \"chalk\"\nimport { downloadFile, getDownloaded } from \"../main/file-downloader\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\n console.log(\"--------\")\n console.log(`🕗 Downloading All Stylesheets`)\n await waittime(1000)\n\n const dir = `${useDir}/css`\n\n for (let i = 0; i < fontlist.length; i++) {\n const url = fontlist[i]\n const progress = `[${i + 1}/${fontlist.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(chalk.greenBright(\"✅ Stylesheets Downloaded\"))\n await waittime(1000)\n return getDownloaded()\n}\n","import { Downloader } from \"nodejs-file-downloader\"\nimport { addDir } from \"./dir-checker\"\nimport chalk from \"chalk\"\n\nlet filesDownloaded: string[] = []\n\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\n await addDir(`${filedir}`)\n const downloader = new Downloader({\n url: fileurl,\n directory: `./${filedir}`,\n cloneFiles: false\n })\n try {\n await downloader.download()\n const fileorigin = fileurl.split(\"/\")\n const filename = fileorigin[fileorigin.length - 1]\n console.log(`🚀 ${progress ? chalk.yellow(progress) + \" \" : \"\"}${filename}`)\n filesDownloaded.push(filename)\n } catch (_error) {\n throw new Error(chalk.red(\"The version you wanted to download is not available. Please use other release version.\"))\n }\n}\nexport function getDownloaded(): string[] {\n const files: string[] = [...filesDownloaded]\n filesDownloaded = []\n return files\n}\n","import fs from \"fs\"\nimport waittime from \"../helper/waittime\"\n\nexport async function addDir(dirpath: string): Promise<void> {\n let curpath = \".\"\n const dirs: string[] = dirpath.split(\"/\")\n\n for (const dir of dirs) {\n curpath += `/${dir}`\n if (!fs.existsSync(curpath)) {\n fs.mkdirSync(curpath)\n await waittime(100)\n }\n }\n}\n","import { addDir } from \"../main/dir-checker\"\nimport waittime from \"../helper/waittime\"\nimport { extractFont, getFonts } from \"../main/font-extractor\"\nimport { downloadFile } from \"../main/file-downloader\"\nimport chalk from \"chalk\"\n\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\n console.log(\"--------\")\n console.log(\"🕗 Reading Available Webfonts\")\n const dir = `${useDir}/css`\n for (const sheet of sheets) {\n await extractFont(sheet, dir)\n }\n const fonts = getFonts()\n console.log(\"✅ Found \" + chalk.green(fonts.length.toString()) + \" Webfonts\")\n await waittime(1000)\n return fonts\n}\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\n const dir = `${filedir}/webfonts`\n await addDir(dir)\n const fonturl = baseUrl\n console.log(\"--------\")\n console.log(\"🕗 Downloading All Webfonts\")\n await waittime(1000)\n for (let i = 0; i < fonts.length; i++) {\n const font = fonts[i].replace(\"..\", \"\")\n const url = `${fonturl}${font}`\n const progress = `[${i + 1}/${fonts.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(chalk.greenBright(\"✅ Webfonts Downloaded\"))\n}\n","import fs from \"fs\"\nimport postcss from \"postcss\"\nimport safeParser from \"postcss-safe-parser\"\n\nlet fontUrls: string[] = []\n\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\n postcss()\n .process(css, { parser: safeParser, from: undefined })\n .then((result) => {\n result.root.walkAtRules(\"font-face\", (rule) => {\n rule.walkDecls(\"src\", (decl) => {\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\n if (matches) {\n matches.forEach((url) => {\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\n fontUrls.push(cleanUrl)\n })\n }\n })\n })\n })\n}\n\nexport function getFonts(): string[] {\n const fixedFonts: string[] = [...fontUrls]\n fontUrls = []\n return fixedFonts\n}\n","import { Ver } from \"./fa.types\"\nimport defVer from \"../json/fonts.json\"\nimport waittime from \"../helper/waittime\"\nimport chalk from \"chalk\"\n\nasync function getVersion(): Promise<Ver> {\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\n\n return await fetch(url, {\n method: \"GET\"\n })\n .then((res) => res.json())\n .then((res) => {\n console.log(`✅ Found: v${res.version}`)\n return res\n })\n .catch(() => {\n console.log(`⛔ Error getting the latest version!`)\n console.log(`⛔ Forced Using v${defVer.version}`)\n return defVer\n })\n}\n\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\n console.log(\"--------\")\n console.log(\"🕗 Checking Latest Version\")\n await waittime(1000)\n const curFonts = await getVersion()\n await waittime(100)\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n console.log(chalk.bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro Plus -- `))\n await waittime(1000)\n console.log(\" \")\n console.log(\"--------\")\n await waittime(100)\n console.log(\"🕗 Reading Available Stylesheets\")\n await waittime(500)\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\n console.log(\"✅ Found \" + chalk.green(fontlist.length.toString()) + \" Sytlesheets\")\n await waittime(1000)\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\n}\n","{ \"version\": \"7.0.0\", \"root\": \"https://site-assets.fontawesome.com/releases/v7.0.0\", \"css\": [\"fontawesome.css\", \"whiteboard-semibold.css\", \"thumbprint-light.css\", \"slab-press-regular.css\", \"slab-regular.css\", \"sharp-duotone-thin.css\", \"sharp-duotone-solid.css\", \"sharp-duotone-regular.css\", \"sharp-duotone-light.css\", \"sharp-thin.css\", \"sharp-solid.css\", \"sharp-regular.css\", \"sharp-light.css\", \"notdog-duo-solid.css\", \"notdog-solid.css\", \"jelly-fill-regular.css\", \"jelly-duo-regular.css\", \"jelly-regular.css\", \"etch-solid.css\", \"duotone-thin.css\", \"duotone.css\", \"duotone-regular.css\", \"duotone-light.css\", \"thin.css\", \"solid.css\", \"regular.css\", \"light.css\", \"brands.css\", \"chisel-regular.css\"] }\n","import chalk from \"chalk\"\nimport waittime from \"../helper/waittime\"\nimport { question } from \"../main/question\"\n\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\n console.log(chalk.bgCyan.black(\" -- Font Awesome Pro Plus Downloader | Devanka761 -- \"))\n await waittime(500)\n console.log(\"\")\n console.log(\"--------\")\n console.log(`Font Awesome Pro Plus Downloader was made for ${chalk.yellow(\"educational purposes\")} only!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`This downloader provides ${chalk.bold.green(\"Paid (Pro Plus) Version\")} for the latest Official Package. It is intended for ${chalk.yellow(\"experimental\")} and ${chalk.yellow(\"personal use\")} only. It is ${chalk.red(\"licensed for commercial\")} use.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`${chalk.red(\"DO NOT\")} use this downloader if you are not a ${chalk.bold.green(\"Creator\")} or you have never buy the official product from the official website.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the ${chalk.green(\"Font Awesome\")} webiste: ${chalk.green(\"https://fontawesome.com/plans\")}`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(500)\n let agree = await question(`Continue to download? (${chalk.cyan(\"Y\")}/n) `)\n agree = agree ? agree.toLowerCase() : \"y\"\n const notAgrees = [\"no\", \"n\", \"nope\"]\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\n console.log(chalk.cyan(isOk ? \"y\" : \"n\"))\n if (!isOk) {\n console.log(\"--------\")\n await waittime(1000)\n console.log(chalk.red(\"⛔ Font Awesome Pro Plus Downloader Canceled\"))\n await waittime(1000)\n console.log(chalk.bgRed.black(\" --- DONE --- \"))\n }\n\n return { isOk }\n}\n"],"names":[],"version":3,"file":"index.cjs.map","sourceRoot":"../"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;ACAe,kDAAkB,KAAa,GAAG,EAAE,IAAY,CAAC;IAC9D,OAAO,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS,KAAK;AAC3D;;;;AEAO,SAAS,0CAAS,IAAY;IACnC,OAAO,IAAI,QAAQ,CAAC;QAClB,MAAM,KAAK,CAAA,GAAA,yCAAO,EAAE,eAAe,CAAC;YAClC,OAAO,QAAQ,KAAK;YACpB,QAAQ,QAAQ,MAAM;QACxB;QACA,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,QAAQ;YACR,GAAG,KAAK;QACV;IACF;AACF;;;;ADVe;IACb,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,CAAC,sBAAsB,CAAC;IACpC,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,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GAAG,CAAC;IACd;IAEA,OAAO;cAAE;IAAK;AAChB;;;AX/BA,eAAe;IACb,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,KAAK;IACb,MAAM,QAAE,IAAI,EAAE,GAAG,MAAM,CAAA,GAAA,wCAAe;IACtC,IAAI,CAAC,MAAM;IACX,MAAM,UAAE,MAAM,EAAE,GAAG,MAAM,CAAA,GAAA,wCAAU;IACnC,MAAM,YAAE,QAAQ,UAAE,MAAM,WAAE,OAAO,EAAE,GAAG,MAAM,CAAA,GAAA,wCAAW;IACvD,MAAM,UAAoB,MAAM,CAAA,GAAA,wCAAU,EAAE,QAAQ,QAAQ;IAC5D,MAAM,WAAqB,MAAM,CAAA,GAAA,yCAAQ,EAAE,SAAS;IACpD,MAAM,CAAA,GAAA,yCAAY,EAAE,UAAU,QAAQ;IACtC,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,CAAC,sBAAe,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,yBAAyB,CAAC;IACjG,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;AACjB;AACO,SAAS;IACd;AACF;AACO,SAAS;IACd;AACF","sources":["src/index.ts","src/helper/waittime.ts","src/pages/askQuestions.ts","src/main/question.ts","src/pages/cssDownload.ts","src/main/file-downloader.ts","src/main/dir-checker.ts","src/pages/fontsDownload.ts","src/main/font-extractor.ts","src/pages/versionCheck.ts","src/json/fonts.json","src/pages/noticeOfficial.ts"],"sourcesContent":["import waittime from \"./helper/waittime\"\nimport askQuestion from \"./pages/askQuestions\"\nimport cssDownload from \"./pages/cssDownload\"\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\nimport checkVersion from \"./pages/versionCheck\"\nimport unofficialNotice from \"./pages/noticeOfficial\"\n\nasync function startDownloader(): Promise<void> {\n await waittime(100)\n console.clear()\n const { isOk } = await unofficialNotice()\n if (!isOk) return\n const { useDir } = await askQuestion()\n const { fontlist, useVer, baseUrl } = await checkVersion()\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\n await downloadFonts(fontUrls, useDir, baseUrl)\n await waittime(1000)\n console.log(\"--------\")\n await waittime(1000)\n console.log(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`)\n await waittime(1000)\n console.log(\"DONE\")\n await waittime(1000)\n}\nexport function getFontAwesomePro(): void {\n startDownloader()\n}\nexport function getFapro(): void {\n startDownloader()\n}\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms - n))\n}\n","import { question } from \"../main/question\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function askQuestion(): Promise<{ useDir: string }> {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n await waittime(100)\n console.log(`Set the Download Path!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"Download path can be \" + \"`path/to/your/public/folder`\" + \" or \" + \"`anything`\" + \".\")\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"if the path does not exist, it will be created automatically.\")\n await waittime(500)\n console.log(\"--------\")\n const dir = await question(`Enter download path: (fapro) `)\n const useDir = dir ? dir : \"fapro\"\n console.log(`${useDir}${dir ? \"\" : \" (default)\"}`)\n console.log(\"--------\")\n await waittime(750)\n console.log(\" \")\n console.log(\"Preparing Downloader\")\n await waittime(2250)\n console.log(\" \")\n return { useDir }\n}\n","import readline from \"readline\"\n\nexport function question(text: string): Promise<string> {\n return new Promise((resolve) => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n rl.question(text, (anwer) => {\n resolve(anwer)\n rl.close()\n })\n })\n}\n","import { downloadFile, getDownloaded } from \"../main/file-downloader\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\n console.log(\"--------\")\n console.log(`🕗 Downloading All Stylesheets`)\n await waittime(1000)\n\n const dir = `${useDir}/css`\n\n for (let i = 0; i < fontlist.length; i++) {\n const url = fontlist[i]\n const progress = `[${i + 1}/${fontlist.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(\"✅ Stylesheets Downloaded\")\n await waittime(1000)\n return getDownloaded()\n}\n","import { Downloader } from \"nodejs-file-downloader\"\nimport { addDir } from \"./dir-checker\"\n\nlet filesDownloaded: string[] = []\n\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\n await addDir(`${filedir}`)\n const downloader = new Downloader({\n url: fileurl,\n directory: `./${filedir}`,\n cloneFiles: false\n })\n try {\n await downloader.download()\n const fileorigin = fileurl.split(\"/\")\n const filename = fileorigin[fileorigin.length - 1]\n console.log(`🚀 ${progress ? progress + \" \" : \"\"}${filename}`)\n filesDownloaded.push(filename)\n } catch (_error) {\n throw new Error(\"The version you wanted to download is not available. Please use other release version.\")\n }\n}\nexport function getDownloaded(): string[] {\n const files: string[] = [...filesDownloaded]\n filesDownloaded = []\n return files\n}\n","import fs from \"fs\"\nimport waittime from \"../helper/waittime\"\n\nexport async function addDir(dirpath: string): Promise<void> {\n let curpath = \".\"\n const dirs: string[] = dirpath.split(\"/\")\n\n for (const dir of dirs) {\n curpath += `/${dir}`\n if (!fs.existsSync(curpath)) {\n fs.mkdirSync(curpath)\n await waittime(100)\n }\n }\n}\n","import { addDir } from \"../main/dir-checker\"\nimport waittime from \"../helper/waittime\"\nimport { extractFont, getFonts } from \"../main/font-extractor\"\nimport { downloadFile } from \"../main/file-downloader\"\n\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\n console.log(\"--------\")\n console.log(\"🕗 Reading Available Webfonts\")\n const dir = `${useDir}/css`\n for (const sheet of sheets) {\n await extractFont(sheet, dir)\n }\n const fonts = getFonts()\n console.log(\"✅ Found \" + fonts.length.toString() + \" Webfonts\")\n await waittime(1000)\n return fonts\n}\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\n const dir = `${filedir}/webfonts`\n await addDir(dir)\n const fonturl = baseUrl\n console.log(\"--------\")\n console.log(\"🕗 Downloading All Webfonts\")\n await waittime(1000)\n for (let i = 0; i < fonts.length; i++) {\n const font = fonts[i].replace(\"..\", \"\")\n const url = `${fonturl}${font}`\n const progress = `[${i + 1}/${fonts.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(\"✅ Webfonts Downloaded\")\n}\n","import fs from \"fs\"\nimport postcss from \"postcss\"\nimport safeParser from \"postcss-safe-parser\"\n\nlet fontUrls: string[] = []\n\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\n postcss()\n .process(css, { parser: safeParser, from: undefined })\n .then((result) => {\n result.root.walkAtRules(\"font-face\", (rule) => {\n rule.walkDecls(\"src\", (decl) => {\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\n if (matches) {\n matches.forEach((url) => {\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\n fontUrls.push(cleanUrl)\n })\n }\n })\n })\n })\n}\n\nexport function getFonts(): string[] {\n const fixedFonts: string[] = [...fontUrls]\n fontUrls = []\n return fixedFonts\n}\n","import { Ver } from \"./fa.types\"\nimport defVer from \"../json/fonts.json\"\nimport waittime from \"../helper/waittime\"\n\nasync function getVersion(): Promise<Ver> {\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\n\n return await fetch(url, {\n method: \"GET\"\n })\n .then((res) => res.json())\n .then((res) => {\n console.log(`✅ Found: v${res.version}`)\n return res\n })\n .catch(() => {\n console.log(`⛔ Error getting the latest version!`)\n console.log(`⛔ Forced Using v${defVer.version}`)\n return defVer\n })\n}\n\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\n console.log(\"--------\")\n console.log(\"🕗 Checking Latest Version\")\n await waittime(1000)\n const curFonts = await getVersion()\n await waittime(100)\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n console.log(`Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro Plus`)\n await waittime(1000)\n console.log(\" \")\n console.log(\"--------\")\n await waittime(100)\n console.log(\"🕗 Reading Available Stylesheets\")\n await waittime(500)\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\n console.log(\"✅ Found \" + fontlist.length.toString() + \" Sytlesheets\")\n await waittime(1000)\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\n}\n","{ \"version\": \"7.0.0\", \"root\": \"https://site-assets.fontawesome.com/releases/v7.0.0\", \"css\": [\"fontawesome.css\", \"whiteboard-semibold.css\", \"thumbprint-light.css\", \"slab-press-regular.css\", \"slab-regular.css\", \"sharp-duotone-thin.css\", \"sharp-duotone-solid.css\", \"sharp-duotone-regular.css\", \"sharp-duotone-light.css\", \"sharp-thin.css\", \"sharp-solid.css\", \"sharp-regular.css\", \"sharp-light.css\", \"notdog-duo-solid.css\", \"notdog-solid.css\", \"jelly-fill-regular.css\", \"jelly-duo-regular.css\", \"jelly-regular.css\", \"etch-solid.css\", \"duotone-thin.css\", \"duotone.css\", \"duotone-regular.css\", \"duotone-light.css\", \"thin.css\", \"solid.css\", \"regular.css\", \"light.css\", \"brands.css\", \"chisel-regular.css\"] }\n","import waittime from \"../helper/waittime\"\nimport { question } from \"../main/question\"\n\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\n console.log(\"Font Awesome Pro Plus Downloader | Devanka761\")\n await waittime(500)\n console.log(\"\")\n console.log(\"--------\")\n console.log(`Font Awesome Pro Plus Downloader was made for educational purposes only!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`This downloader provides Paid (Pro Plus) Version for the latest Official Package. It is intended for experimental and personal use only. It is licensed for commercial use.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`DO NOT use this downloader if you are not a Creator or you have never buy the official product from the official website.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the Font Awesome webiste: https://fontawesome.com/plans`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(500)\n let agree = await question(`Continue to download? (Y/n) `)\n agree = agree ? agree.toLowerCase() : \"y\"\n const notAgrees = [\"no\", \"n\", \"nope\"]\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\n console.log(isOk ? \"y\" : \"n\")\n if (!isOk) {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\"⛔ Font Awesome Pro Plus Downloader Canceled\")\n await waittime(1000)\n console.log(\"DONE\")\n }\n\n return { isOk }\n}\n"],"names":[],"version":3,"file":"index.cjs.map","sourceRoot":"../"}
|
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import $hSjDC$chalk from "chalk";
|
|
2
1
|
import $hSjDC$readline from "readline";
|
|
3
2
|
import {Downloader as $hSjDC$Downloader} from "nodejs-file-downloader";
|
|
4
3
|
import $hSjDC$fs from "fs";
|
|
@@ -9,14 +8,12 @@ import $hSjDC$postcsssafeparser from "postcss-safe-parser";
|
|
|
9
8
|
function $parcel$interopDefault(a) {
|
|
10
9
|
return a && a.__esModule ? a.default : a;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
function $a777439b98e3ff1b$export$2e2bcd8739ae039(ms = 500, n = 5) {
|
|
14
12
|
return new Promise((resolve)=>setTimeout(resolve, ms - n));
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
|
|
18
16
|
|
|
19
|
-
|
|
20
17
|
function $eb80b25db258156d$export$db9f06b5d27d15d8(text) {
|
|
21
18
|
return new Promise((resolve)=>{
|
|
22
19
|
const rl = (0, $hSjDC$readline).createInterface({
|
|
@@ -37,24 +34,24 @@ async function $1208536e777ab3f1$export$2e2bcd8739ae039() {
|
|
|
37
34
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
38
35
|
console.log(" ");
|
|
39
36
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
40
|
-
console.log(`Set the
|
|
37
|
+
console.log(`Set the Download Path!`);
|
|
41
38
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
42
39
|
console.log("--------");
|
|
43
40
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
44
|
-
console.log("Download path can be
|
|
41
|
+
console.log("Download path can be `path/to/your/public/folder` or `anything`.");
|
|
45
42
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
46
43
|
console.log("--------");
|
|
47
44
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
48
45
|
console.log("if the path does not exist, it will be created automatically.");
|
|
49
46
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(500);
|
|
50
47
|
console.log("--------");
|
|
51
|
-
const dir = await (0, $eb80b25db258156d$export$db9f06b5d27d15d8)(`Enter download path:
|
|
48
|
+
const dir = await (0, $eb80b25db258156d$export$db9f06b5d27d15d8)(`Enter download path: (fapro) `);
|
|
52
49
|
const useDir = dir ? dir : "fapro";
|
|
53
|
-
console.log(
|
|
50
|
+
console.log(`${useDir}${dir ? "" : " (default)"}`);
|
|
54
51
|
console.log("--------");
|
|
55
52
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(750);
|
|
56
53
|
console.log(" ");
|
|
57
|
-
console.log(
|
|
54
|
+
console.log("Preparing Downloader");
|
|
58
55
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2250);
|
|
59
56
|
console.log(" ");
|
|
60
57
|
return {
|
|
@@ -66,7 +63,6 @@ async function $1208536e777ab3f1$export$2e2bcd8739ae039() {
|
|
|
66
63
|
|
|
67
64
|
|
|
68
65
|
|
|
69
|
-
|
|
70
66
|
async function $fb617e32957cfdd1$export$75ad550fa5fe1d36(dirpath) {
|
|
71
67
|
let curpath = ".";
|
|
72
68
|
const dirs = dirpath.split("/");
|
|
@@ -80,7 +76,6 @@ async function $fb617e32957cfdd1$export$75ad550fa5fe1d36(dirpath) {
|
|
|
80
76
|
}
|
|
81
77
|
|
|
82
78
|
|
|
83
|
-
|
|
84
79
|
let $79f93e09d37d22af$var$filesDownloaded = [];
|
|
85
80
|
async function $79f93e09d37d22af$export$bb3b75778e3e272(fileurl, filedir, progress = null) {
|
|
86
81
|
await (0, $fb617e32957cfdd1$export$75ad550fa5fe1d36)(`${filedir}`);
|
|
@@ -93,10 +88,10 @@ async function $79f93e09d37d22af$export$bb3b75778e3e272(fileurl, filedir, progre
|
|
|
93
88
|
await downloader.download();
|
|
94
89
|
const fileorigin = fileurl.split("/");
|
|
95
90
|
const filename = fileorigin[fileorigin.length - 1];
|
|
96
|
-
console.log(`\u{1F680} ${progress ?
|
|
91
|
+
console.log(`\u{1F680} ${progress ? progress + " " : ""}${filename}`);
|
|
97
92
|
$79f93e09d37d22af$var$filesDownloaded.push(filename);
|
|
98
93
|
} catch (_error) {
|
|
99
|
-
throw new Error(
|
|
94
|
+
throw new Error("The version you wanted to download is not available. Please use other release version.");
|
|
100
95
|
}
|
|
101
96
|
}
|
|
102
97
|
function $79f93e09d37d22af$export$8de8b92fd301c83e() {
|
|
@@ -119,7 +114,7 @@ async function $ccfdb89c88d6a2d0$export$2e2bcd8739ae039(useVer, useDir, fontlist
|
|
|
119
114
|
const progress = `[${i + 1}/${fontlist.length}]`;
|
|
120
115
|
await (0, $79f93e09d37d22af$export$bb3b75778e3e272)(url, dir, progress);
|
|
121
116
|
}
|
|
122
|
-
console.log(
|
|
117
|
+
console.log("\u2705 Stylesheets Downloaded");
|
|
123
118
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
124
119
|
return (0, $79f93e09d37d22af$export$8de8b92fd301c83e)();
|
|
125
120
|
}
|
|
@@ -158,14 +153,13 @@ function $1ffd869ab3f86381$export$cbcfe4007f417765() {
|
|
|
158
153
|
|
|
159
154
|
|
|
160
155
|
|
|
161
|
-
|
|
162
156
|
async function $9ff909d4a69662c1$export$ae70b50decb7cf58(sheets, useDir) {
|
|
163
157
|
console.log("--------");
|
|
164
158
|
console.log("\uD83D\uDD57 Reading Available Webfonts");
|
|
165
159
|
const dir = `${useDir}/css`;
|
|
166
160
|
for (const sheet of sheets)await (0, $1ffd869ab3f86381$export$85c953af022fd6f3)(sheet, dir);
|
|
167
161
|
const fonts = (0, $1ffd869ab3f86381$export$cbcfe4007f417765)();
|
|
168
|
-
console.log("\u2705 Found " +
|
|
162
|
+
console.log("\u2705 Found " + fonts.length.toString() + " Webfonts");
|
|
169
163
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
170
164
|
return fonts;
|
|
171
165
|
}
|
|
@@ -182,7 +176,7 @@ async function $9ff909d4a69662c1$export$6c18a7d4cf131851(fonts, filedir, baseUrl
|
|
|
182
176
|
const progress = `[${i + 1}/${fonts.length}]`;
|
|
183
177
|
await (0, $79f93e09d37d22af$export$bb3b75778e3e272)(url, dir, progress);
|
|
184
178
|
}
|
|
185
|
-
console.log(
|
|
179
|
+
console.log("\u2705 Webfonts Downloaded");
|
|
186
180
|
}
|
|
187
181
|
|
|
188
182
|
|
|
@@ -191,7 +185,6 @@ $2fec5fa9afe64cbe$exports = JSON.parse("{\"version\":\"7.0.0\",\"root\":\"https:
|
|
|
191
185
|
|
|
192
186
|
|
|
193
187
|
|
|
194
|
-
|
|
195
188
|
async function $6057a7b12f1c52d2$var$getVersion() {
|
|
196
189
|
const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`;
|
|
197
190
|
return await fetch(url, {
|
|
@@ -214,7 +207,7 @@ async function $6057a7b12f1c52d2$export$2e2bcd8739ae039() {
|
|
|
214
207
|
console.log("--------");
|
|
215
208
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
216
209
|
console.log(" ");
|
|
217
|
-
console.log(
|
|
210
|
+
console.log(`Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(".")[0]} Pro Plus`);
|
|
218
211
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
219
212
|
console.log(" ");
|
|
220
213
|
console.log("--------");
|
|
@@ -222,7 +215,7 @@ async function $6057a7b12f1c52d2$export$2e2bcd8739ae039() {
|
|
|
222
215
|
console.log("\uD83D\uDD57 Reading Available Stylesheets");
|
|
223
216
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(500);
|
|
224
217
|
const fontlist = curFonts.css.map((file)=>`${curFonts.root}/css/${file}`);
|
|
225
|
-
console.log("\u2705 Found " +
|
|
218
|
+
console.log("\u2705 Found " + fontlist.length.toString() + " Sytlesheets");
|
|
226
219
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
227
220
|
return {
|
|
228
221
|
fontlist: fontlist,
|
|
@@ -234,29 +227,28 @@ async function $6057a7b12f1c52d2$export$2e2bcd8739ae039() {
|
|
|
234
227
|
|
|
235
228
|
|
|
236
229
|
|
|
237
|
-
|
|
238
230
|
async function $763cbf9c5fe61a09$export$2e2bcd8739ae039() {
|
|
239
|
-
console.log(
|
|
231
|
+
console.log("Font Awesome Pro Plus Downloader | Devanka761");
|
|
240
232
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(500);
|
|
241
233
|
console.log("");
|
|
242
234
|
console.log("--------");
|
|
243
|
-
console.log(`Font Awesome Pro Plus Downloader was made for
|
|
235
|
+
console.log(`Font Awesome Pro Plus Downloader was made for educational purposes only!`);
|
|
244
236
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
245
237
|
console.log("--------");
|
|
246
238
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
247
|
-
console.log(`This downloader provides
|
|
239
|
+
console.log(`This downloader provides Paid (Pro Plus) Version for the latest Official Package. It is intended for experimental and personal use only. It is licensed for commercial use.`);
|
|
248
240
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
249
241
|
console.log("--------");
|
|
250
242
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
251
|
-
console.log(
|
|
243
|
+
console.log(`DO NOT use this downloader if you are not a Creator or you have never buy the official product from the official website.`);
|
|
252
244
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
253
245
|
console.log("--------");
|
|
254
246
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
255
|
-
console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the
|
|
247
|
+
console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the Font Awesome webiste: https://fontawesome.com/plans`);
|
|
256
248
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
257
249
|
console.log("--------");
|
|
258
250
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(500);
|
|
259
|
-
let agree = await (0, $eb80b25db258156d$export$db9f06b5d27d15d8)(`Continue to download? (
|
|
251
|
+
let agree = await (0, $eb80b25db258156d$export$db9f06b5d27d15d8)(`Continue to download? (Y/n) `);
|
|
260
252
|
agree = agree ? agree.toLowerCase() : "y";
|
|
261
253
|
const notAgrees = [
|
|
262
254
|
"no",
|
|
@@ -264,13 +256,13 @@ async function $763cbf9c5fe61a09$export$2e2bcd8739ae039() {
|
|
|
264
256
|
"nope"
|
|
265
257
|
];
|
|
266
258
|
const isOk = notAgrees.find((textNo)=>textNo === agree) ? false : true;
|
|
267
|
-
console.log(
|
|
259
|
+
console.log(isOk ? "y" : "n");
|
|
268
260
|
if (!isOk) {
|
|
269
261
|
console.log("--------");
|
|
270
262
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
271
|
-
console.log(
|
|
263
|
+
console.log("\u26D4 Font Awesome Pro Plus Downloader Canceled");
|
|
272
264
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
273
|
-
console.log(
|
|
265
|
+
console.log("DONE");
|
|
274
266
|
}
|
|
275
267
|
return {
|
|
276
268
|
isOk: isOk
|
|
@@ -291,9 +283,9 @@ async function $eb17f609fec572d7$var$startDownloader() {
|
|
|
291
283
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
292
284
|
console.log("--------");
|
|
293
285
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
294
|
-
console.log(
|
|
286
|
+
console.log(`\u{2705} Font Awesome ${useVer.split(".")[0]} Pro Plus v${useVer} Downloaded Successfully!`);
|
|
295
287
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
296
|
-
console.log(
|
|
288
|
+
console.log("DONE");
|
|
297
289
|
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
298
290
|
}
|
|
299
291
|
function $eb17f609fec572d7$export$c0a0c3a161860b55() {
|
package/dist/module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;ACAe,kDAAkB,KAAa,GAAG,EAAE,IAAY,CAAC;IAC9D,OAAO,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS,KAAK;AAC3D;;;;;AEAO,SAAS,0CAAS,IAAY;IACnC,OAAO,IAAI,QAAQ,CAAC;QAClB,MAAM,KAAK,CAAA,GAAA,eAAO,EAAE,eAAe,CAAC;YAClC,OAAO,QAAQ,KAAK;YACpB,QAAQ,QAAQ,MAAM;QACxB;QACA,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,QAAQ;YACR,GAAG,KAAK;QACV;IACF;AACF;;;;ADT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,GAAA,wCAAO,EAAE;AACjB;AACO,SAAS;IACd;AACF;AACO,SAAS;IACd;AACF","sources":["src/index.ts","src/helper/waittime.ts","src/pages/askQuestions.ts","src/main/question.ts","src/pages/cssDownload.ts","src/main/file-downloader.ts","src/main/dir-checker.ts","src/pages/fontsDownload.ts","src/main/font-extractor.ts","src/pages/versionCheck.ts","src/json/fonts.json","src/pages/noticeOfficial.ts"],"sourcesContent":["import chalk from \"chalk\"\nimport waittime from \"./helper/waittime\"\nimport askQuestion from \"./pages/askQuestions\"\nimport cssDownload from \"./pages/cssDownload\"\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\nimport checkVersion from \"./pages/versionCheck\"\nimport unofficialNotice from \"./pages/noticeOfficial\"\n\nasync function startDownloader(): Promise<void> {\n await waittime(100)\n console.clear()\n const { isOk } = await unofficialNotice()\n if (!isOk) return\n const { useDir } = await askQuestion()\n const { fontlist, useVer, baseUrl } = await checkVersion()\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\n await downloadFonts(fontUrls, useDir, baseUrl)\n await waittime(1000)\n console.log(\"--------\")\n await waittime(1000)\n console.log(chalk.green(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`))\n await waittime(1000)\n console.log(chalk.bgGreen.black(\" --- DONE --- \"))\n await waittime(1000)\n}\nexport function getFontAwesomePro(): void {\n startDownloader()\n}\nexport function getFapro(): void {\n startDownloader()\n}\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms - n))\n}\n","import chalk from \"chalk\"\nimport { question } from \"../main/question\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function askQuestion(): Promise<{ useDir: string }> {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n await waittime(100)\n console.log(`Set the ${chalk.cyan(\"Download Path\")}!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"Download path can be \" + chalk.cyan(\"`path/to/your/public/folder`\") + \" or \" + chalk.cyan(\"`anything`\") + \".\")\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"if the path does not exist, it will be created automatically.\")\n await waittime(500)\n console.log(\"--------\")\n const dir = await question(`Enter download path: ${chalk.bold.cyan(\"(fapro)\")} `)\n const useDir = dir ? dir : \"fapro\"\n console.log(chalk.bold.cyan(`${useDir}`) + `${dir ? \"\" : \" (default)\"}`)\n console.log(\"--------\")\n await waittime(750)\n console.log(\" \")\n console.log(chalk.bgYellow.black(\" -- Preparing Downloader -- \"))\n await waittime(2250)\n console.log(\" \")\n return { useDir }\n}\n","import readline from \"readline\"\n\nexport function question(text: string): Promise<string> {\n return new Promise((resolve) => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n rl.question(text, (anwer) => {\n resolve(anwer)\n rl.close()\n })\n })\n}\n","import chalk from \"chalk\"\nimport { downloadFile, getDownloaded } from \"../main/file-downloader\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\n console.log(\"--------\")\n console.log(`🕗 Downloading All Stylesheets`)\n await waittime(1000)\n\n const dir = `${useDir}/css`\n\n for (let i = 0; i < fontlist.length; i++) {\n const url = fontlist[i]\n const progress = `[${i + 1}/${fontlist.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(chalk.greenBright(\"✅ Stylesheets Downloaded\"))\n await waittime(1000)\n return getDownloaded()\n}\n","import { Downloader } from \"nodejs-file-downloader\"\nimport { addDir } from \"./dir-checker\"\nimport chalk from \"chalk\"\n\nlet filesDownloaded: string[] = []\n\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\n await addDir(`${filedir}`)\n const downloader = new Downloader({\n url: fileurl,\n directory: `./${filedir}`,\n cloneFiles: false\n })\n try {\n await downloader.download()\n const fileorigin = fileurl.split(\"/\")\n const filename = fileorigin[fileorigin.length - 1]\n console.log(`🚀 ${progress ? chalk.yellow(progress) + \" \" : \"\"}${filename}`)\n filesDownloaded.push(filename)\n } catch (_error) {\n throw new Error(chalk.red(\"The version you wanted to download is not available. Please use other release version.\"))\n }\n}\nexport function getDownloaded(): string[] {\n const files: string[] = [...filesDownloaded]\n filesDownloaded = []\n return files\n}\n","import fs from \"fs\"\nimport waittime from \"../helper/waittime\"\n\nexport async function addDir(dirpath: string): Promise<void> {\n let curpath = \".\"\n const dirs: string[] = dirpath.split(\"/\")\n\n for (const dir of dirs) {\n curpath += `/${dir}`\n if (!fs.existsSync(curpath)) {\n fs.mkdirSync(curpath)\n await waittime(100)\n }\n }\n}\n","import { addDir } from \"../main/dir-checker\"\nimport waittime from \"../helper/waittime\"\nimport { extractFont, getFonts } from \"../main/font-extractor\"\nimport { downloadFile } from \"../main/file-downloader\"\nimport chalk from \"chalk\"\n\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\n console.log(\"--------\")\n console.log(\"🕗 Reading Available Webfonts\")\n const dir = `${useDir}/css`\n for (const sheet of sheets) {\n await extractFont(sheet, dir)\n }\n const fonts = getFonts()\n console.log(\"✅ Found \" + chalk.green(fonts.length.toString()) + \" Webfonts\")\n await waittime(1000)\n return fonts\n}\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\n const dir = `${filedir}/webfonts`\n await addDir(dir)\n const fonturl = baseUrl\n console.log(\"--------\")\n console.log(\"🕗 Downloading All Webfonts\")\n await waittime(1000)\n for (let i = 0; i < fonts.length; i++) {\n const font = fonts[i].replace(\"..\", \"\")\n const url = `${fonturl}${font}`\n const progress = `[${i + 1}/${fonts.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(chalk.greenBright(\"✅ Webfonts Downloaded\"))\n}\n","import fs from \"fs\"\nimport postcss from \"postcss\"\nimport safeParser from \"postcss-safe-parser\"\n\nlet fontUrls: string[] = []\n\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\n postcss()\n .process(css, { parser: safeParser, from: undefined })\n .then((result) => {\n result.root.walkAtRules(\"font-face\", (rule) => {\n rule.walkDecls(\"src\", (decl) => {\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\n if (matches) {\n matches.forEach((url) => {\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\n fontUrls.push(cleanUrl)\n })\n }\n })\n })\n })\n}\n\nexport function getFonts(): string[] {\n const fixedFonts: string[] = [...fontUrls]\n fontUrls = []\n return fixedFonts\n}\n","import { Ver } from \"./fa.types\"\nimport defVer from \"../json/fonts.json\"\nimport waittime from \"../helper/waittime\"\nimport chalk from \"chalk\"\n\nasync function getVersion(): Promise<Ver> {\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\n\n return await fetch(url, {\n method: \"GET\"\n })\n .then((res) => res.json())\n .then((res) => {\n console.log(`✅ Found: v${res.version}`)\n return res\n })\n .catch(() => {\n console.log(`⛔ Error getting the latest version!`)\n console.log(`⛔ Forced Using v${defVer.version}`)\n return defVer\n })\n}\n\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\n console.log(\"--------\")\n console.log(\"🕗 Checking Latest Version\")\n await waittime(1000)\n const curFonts = await getVersion()\n await waittime(100)\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n console.log(chalk.bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro Plus -- `))\n await waittime(1000)\n console.log(\" \")\n console.log(\"--------\")\n await waittime(100)\n console.log(\"🕗 Reading Available Stylesheets\")\n await waittime(500)\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\n console.log(\"✅ Found \" + chalk.green(fontlist.length.toString()) + \" Sytlesheets\")\n await waittime(1000)\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\n}\n","{ \"version\": \"7.0.0\", \"root\": \"https://site-assets.fontawesome.com/releases/v7.0.0\", \"css\": [\"fontawesome.css\", \"whiteboard-semibold.css\", \"thumbprint-light.css\", \"slab-press-regular.css\", \"slab-regular.css\", \"sharp-duotone-thin.css\", \"sharp-duotone-solid.css\", \"sharp-duotone-regular.css\", \"sharp-duotone-light.css\", \"sharp-thin.css\", \"sharp-solid.css\", \"sharp-regular.css\", \"sharp-light.css\", \"notdog-duo-solid.css\", \"notdog-solid.css\", \"jelly-fill-regular.css\", \"jelly-duo-regular.css\", \"jelly-regular.css\", \"etch-solid.css\", \"duotone-thin.css\", \"duotone.css\", \"duotone-regular.css\", \"duotone-light.css\", \"thin.css\", \"solid.css\", \"regular.css\", \"light.css\", \"brands.css\", \"chisel-regular.css\"] }\n","import chalk from \"chalk\"\nimport waittime from \"../helper/waittime\"\nimport { question } from \"../main/question\"\n\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\n console.log(chalk.bgCyan.black(\" -- Font Awesome Pro Plus Downloader | Devanka761 -- \"))\n await waittime(500)\n console.log(\"\")\n console.log(\"--------\")\n console.log(`Font Awesome Pro Plus Downloader was made for ${chalk.yellow(\"educational purposes\")} only!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`This downloader provides ${chalk.bold.green(\"Paid (Pro Plus) Version\")} for the latest Official Package. It is intended for ${chalk.yellow(\"experimental\")} and ${chalk.yellow(\"personal use\")} only. It is ${chalk.red(\"licensed for commercial\")} use.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`${chalk.red(\"DO NOT\")} use this downloader if you are not a ${chalk.bold.green(\"Creator\")} or you have never buy the official product from the official website.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the ${chalk.green(\"Font Awesome\")} webiste: ${chalk.green(\"https://fontawesome.com/plans\")}`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(500)\n let agree = await question(`Continue to download? (${chalk.cyan(\"Y\")}/n) `)\n agree = agree ? agree.toLowerCase() : \"y\"\n const notAgrees = [\"no\", \"n\", \"nope\"]\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\n console.log(chalk.cyan(isOk ? \"y\" : \"n\"))\n if (!isOk) {\n console.log(\"--------\")\n await waittime(1000)\n console.log(chalk.red(\"⛔ Font Awesome Pro Plus Downloader Canceled\"))\n await waittime(1000)\n console.log(chalk.bgRed.black(\" --- DONE --- \"))\n }\n\n return { isOk }\n}\n"],"names":[],"version":3,"file":"module.mjs.map","sourceRoot":"../"}
|
|
1
|
+
{"mappings":";;;;;;;;;;ACAe,kDAAkB,KAAa,GAAG,EAAE,IAAY,CAAC;IAC9D,OAAO,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS,KAAK;AAC3D;;;;AEAO,SAAS,0CAAS,IAAY;IACnC,OAAO,IAAI,QAAQ,CAAC;QAClB,MAAM,KAAK,CAAA,GAAA,eAAO,EAAE,eAAe,CAAC;YAClC,OAAO,QAAQ,KAAK;YACpB,QAAQ,QAAQ,MAAM;QACxB;QACA,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,QAAQ;YACR,GAAG,KAAK;QACV;IACF;AACF;;;;ADVe;IACb,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,CAAC,sBAAsB,CAAC;IACpC,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,E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G,MAAM,CAAA,GAAA,wCAAU;IACnC,MAAM,YAAE,QAAQ,UAAE,MAAM,WAAE,OAAO,EAAE,GAAG,MAAM,CAAA,GAAA,wCAAW;IACvD,MAAM,UAAoB,MAAM,CAAA,GAAA,wCAAU,EAAE,QAAQ,QAAQ;IAC5D,MAAM,WAAqB,MAAM,CAAA,GAAA,yCAAQ,EAAE,SAAS;IACpD,MAAM,CAAA,GAAA,yCAAY,EAAE,UAAU,QAAQ;IACtC,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,CAAC,sBAAe,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,yBAAyB,CAAC;IACjG,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;AACjB;AACO,SAAS;IACd;AACF;AACO,SAAS;IACd;AACF","sources":["src/index.ts","src/helper/waittime.ts","src/pages/askQuestions.ts","src/main/question.ts","src/pages/cssDownload.ts","src/main/file-downloader.ts","src/main/dir-checker.ts","src/pages/fontsDownload.ts","src/main/font-extractor.ts","src/pages/versionCheck.ts","src/json/fonts.json","src/pages/noticeOfficial.ts"],"sourcesContent":["import waittime from \"./helper/waittime\"\nimport askQuestion from \"./pages/askQuestions\"\nimport cssDownload from \"./pages/cssDownload\"\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\nimport checkVersion from \"./pages/versionCheck\"\nimport unofficialNotice from \"./pages/noticeOfficial\"\n\nasync function startDownloader(): Promise<void> {\n await waittime(100)\n console.clear()\n const { isOk } = await unofficialNotice()\n if (!isOk) return\n const { useDir } = await askQuestion()\n const { fontlist, useVer, baseUrl } = await checkVersion()\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\n await downloadFonts(fontUrls, useDir, baseUrl)\n await waittime(1000)\n console.log(\"--------\")\n await waittime(1000)\n console.log(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`)\n await waittime(1000)\n console.log(\"DONE\")\n await waittime(1000)\n}\nexport function getFontAwesomePro(): void {\n startDownloader()\n}\nexport function getFapro(): void {\n startDownloader()\n}\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms - n))\n}\n","import { question } from \"../main/question\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function askQuestion(): Promise<{ useDir: string }> {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n await waittime(100)\n console.log(`Set the Download Path!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"Download path can be \" + \"`path/to/your/public/folder`\" + \" or \" + \"`anything`\" + \".\")\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"if the path does not exist, it will be created automatically.\")\n await waittime(500)\n console.log(\"--------\")\n const dir = await question(`Enter download path: (fapro) `)\n const useDir = dir ? dir : \"fapro\"\n console.log(`${useDir}${dir ? \"\" : \" (default)\"}`)\n console.log(\"--------\")\n await waittime(750)\n console.log(\" \")\n console.log(\"Preparing Downloader\")\n await waittime(2250)\n console.log(\" \")\n return { useDir }\n}\n","import readline from \"readline\"\n\nexport function question(text: string): Promise<string> {\n return new Promise((resolve) => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n rl.question(text, (anwer) => {\n resolve(anwer)\n rl.close()\n })\n })\n}\n","import { downloadFile, getDownloaded } from \"../main/file-downloader\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\n console.log(\"--------\")\n console.log(`🕗 Downloading All Stylesheets`)\n await waittime(1000)\n\n const dir = `${useDir}/css`\n\n for (let i = 0; i < fontlist.length; i++) {\n const url = fontlist[i]\n const progress = `[${i + 1}/${fontlist.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(\"✅ Stylesheets Downloaded\")\n await waittime(1000)\n return getDownloaded()\n}\n","import { Downloader } from \"nodejs-file-downloader\"\nimport { addDir } from \"./dir-checker\"\n\nlet filesDownloaded: string[] = []\n\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\n await addDir(`${filedir}`)\n const downloader = new Downloader({\n url: fileurl,\n directory: `./${filedir}`,\n cloneFiles: false\n })\n try {\n await downloader.download()\n const fileorigin = fileurl.split(\"/\")\n const filename = fileorigin[fileorigin.length - 1]\n console.log(`🚀 ${progress ? progress + \" \" : \"\"}${filename}`)\n filesDownloaded.push(filename)\n } catch (_error) {\n throw new Error(\"The version you wanted to download is not available. Please use other release version.\")\n }\n}\nexport function getDownloaded(): string[] {\n const files: string[] = [...filesDownloaded]\n filesDownloaded = []\n return files\n}\n","import fs from \"fs\"\nimport waittime from \"../helper/waittime\"\n\nexport async function addDir(dirpath: string): Promise<void> {\n let curpath = \".\"\n const dirs: string[] = dirpath.split(\"/\")\n\n for (const dir of dirs) {\n curpath += `/${dir}`\n if (!fs.existsSync(curpath)) {\n fs.mkdirSync(curpath)\n await waittime(100)\n }\n }\n}\n","import { addDir } from \"../main/dir-checker\"\nimport waittime from \"../helper/waittime\"\nimport { extractFont, getFonts } from \"../main/font-extractor\"\nimport { downloadFile } from \"../main/file-downloader\"\n\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\n console.log(\"--------\")\n console.log(\"🕗 Reading Available Webfonts\")\n const dir = `${useDir}/css`\n for (const sheet of sheets) {\n await extractFont(sheet, dir)\n }\n const fonts = getFonts()\n console.log(\"✅ Found \" + fonts.length.toString() + \" Webfonts\")\n await waittime(1000)\n return fonts\n}\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\n const dir = `${filedir}/webfonts`\n await addDir(dir)\n const fonturl = baseUrl\n console.log(\"--------\")\n console.log(\"🕗 Downloading All Webfonts\")\n await waittime(1000)\n for (let i = 0; i < fonts.length; i++) {\n const font = fonts[i].replace(\"..\", \"\")\n const url = `${fonturl}${font}`\n const progress = `[${i + 1}/${fonts.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(\"✅ Webfonts Downloaded\")\n}\n","import fs from \"fs\"\nimport postcss from \"postcss\"\nimport safeParser from \"postcss-safe-parser\"\n\nlet fontUrls: string[] = []\n\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\n postcss()\n .process(css, { parser: safeParser, from: undefined })\n .then((result) => {\n result.root.walkAtRules(\"font-face\", (rule) => {\n rule.walkDecls(\"src\", (decl) => {\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\n if (matches) {\n matches.forEach((url) => {\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\n fontUrls.push(cleanUrl)\n })\n }\n })\n })\n })\n}\n\nexport function getFonts(): string[] {\n const fixedFonts: string[] = [...fontUrls]\n fontUrls = []\n return fixedFonts\n}\n","import { Ver } from \"./fa.types\"\nimport defVer from \"../json/fonts.json\"\nimport waittime from \"../helper/waittime\"\n\nasync function getVersion(): Promise<Ver> {\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\n\n return await fetch(url, {\n method: \"GET\"\n })\n .then((res) => res.json())\n .then((res) => {\n console.log(`✅ Found: v${res.version}`)\n return res\n })\n .catch(() => {\n console.log(`⛔ Error getting the latest version!`)\n console.log(`⛔ Forced Using v${defVer.version}`)\n return defVer\n })\n}\n\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\n console.log(\"--------\")\n console.log(\"🕗 Checking Latest Version\")\n await waittime(1000)\n const curFonts = await getVersion()\n await waittime(100)\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n console.log(`Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro Plus`)\n await waittime(1000)\n console.log(\" \")\n console.log(\"--------\")\n await waittime(100)\n console.log(\"🕗 Reading Available Stylesheets\")\n await waittime(500)\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\n console.log(\"✅ Found \" + fontlist.length.toString() + \" Sytlesheets\")\n await waittime(1000)\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\n}\n","{ \"version\": \"7.0.0\", \"root\": \"https://site-assets.fontawesome.com/releases/v7.0.0\", \"css\": [\"fontawesome.css\", \"whiteboard-semibold.css\", \"thumbprint-light.css\", \"slab-press-regular.css\", \"slab-regular.css\", \"sharp-duotone-thin.css\", \"sharp-duotone-solid.css\", \"sharp-duotone-regular.css\", \"sharp-duotone-light.css\", \"sharp-thin.css\", \"sharp-solid.css\", \"sharp-regular.css\", \"sharp-light.css\", \"notdog-duo-solid.css\", \"notdog-solid.css\", \"jelly-fill-regular.css\", \"jelly-duo-regular.css\", \"jelly-regular.css\", \"etch-solid.css\", \"duotone-thin.css\", \"duotone.css\", \"duotone-regular.css\", \"duotone-light.css\", \"thin.css\", \"solid.css\", \"regular.css\", \"light.css\", \"brands.css\", \"chisel-regular.css\"] }\n","import waittime from \"../helper/waittime\"\nimport { question } from \"../main/question\"\n\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\n console.log(\"Font Awesome Pro Plus Downloader | Devanka761\")\n await waittime(500)\n console.log(\"\")\n console.log(\"--------\")\n console.log(`Font Awesome Pro Plus Downloader was made for educational purposes only!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`This downloader provides Paid (Pro Plus) Version for the latest Official Package. It is intended for experimental and personal use only. It is licensed for commercial use.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`DO NOT use this downloader if you are not a Creator or you have never buy the official product from the official website.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the Font Awesome webiste: https://fontawesome.com/plans`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(500)\n let agree = await question(`Continue to download? (Y/n) `)\n agree = agree ? agree.toLowerCase() : \"y\"\n const notAgrees = [\"no\", \"n\", \"nope\"]\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\n console.log(isOk ? \"y\" : \"n\")\n if (!isOk) {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\"⛔ Font Awesome Pro Plus Downloader Canceled\")\n await waittime(1000)\n console.log(\"DONE\")\n }\n\n return { isOk }\n}\n"],"names":[],"version":3,"file":"module.mjs.map","sourceRoot":"../"}
|
package/dist/scss/allstyles.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/allstyles.css";
|
package/dist/scss/brands.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/brands.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/chisel-regular.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/duotone-light.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/duotone-regular.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/duotone-thin.css";
|
package/dist/scss/duotone.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/duotone.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/etch-solid.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/fontawesome.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/jelly-duo-regular.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/jelly-fill-regular.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/jelly-regular.css";
|
package/dist/scss/light.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/light.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/notdog-duo-solid.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/notdog-solid.css";
|
package/dist/scss/regular.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/regular.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/sharp-duotone-light.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/sharp-duotone-regular.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/sharp-duotone-solid.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/sharp-duotone-thin.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/sharp-light.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/sharp-regular.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/sharp-solid.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/sharp-thin.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/slab-press-regular.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/slab-regular.css";
|
package/dist/scss/solid.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/solid.css";
|
package/dist/scss/thin.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/thin.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/thumbprint-light.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "webfont-awesome-pro/css/whiteboard-semibold.css";
|
package/dist/webfapro.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import o from"
|
|
2
|
+
import o from"readline";import{Downloader as e}from"nodejs-file-downloader";import s from"fs";import t from"postcss";import l from"postcss-safe-parser";function n(o){return o&&o.__esModule?o.default:o}function a(o=500,e=5){return new Promise(s=>setTimeout(s,o-e))}function r(e){return new Promise(s=>{let t=o.createInterface({input:process.stdin,output:process.stdout});t.question(e,o=>{s(o),t.close()})})}async function i(){console.log("--------"),await a(1e3),console.log(" "),await a(100),console.log("Set the Download Path!"),await a(100),console.log("--------"),await a(100),console.log("Download path can be `path/to/your/public/folder` or `anything`."),await a(100),console.log("--------"),await a(100),console.log("if the path does not exist, it will be created automatically."),await a(500),console.log("--------");let o=await r("Enter download path: (fapro) "),e=o||"fapro";return console.log(`${e}${o?"":" (default)"}`),console.log("--------"),await a(750),console.log(" "),console.log("Preparing Downloader"),await a(2250),console.log(" "),{useDir:e}}async function c(o){let e=".";for(let t of o.split("/"))e+=`/${t}`,s.existsSync(e)||(s.mkdirSync(e),await a(100))}let u=[];async function w(o,s,t=null){await c(`${s}`);let l=new e({url:o,directory:`./${s}`,cloneFiles:!1});try{await l.download();let e=o.split("/"),s=e[e.length-1];console.log(`\u{1F680} ${t?t+" ":""}${s}`),u.push(s)}catch(o){throw Error("The version you wanted to download is not available. Please use other release version.")}}async function g(o,e,s){console.log("--------"),console.log(`\u{1F557} Downloading All Stylesheets`),await a(1e3);let t=`${e}/css`;for(let o=0;o<s.length;o++){let e=s[o],l=`[${o+1}/${s.length}]`;await w(e,t,l)}console.log("✅ Stylesheets Downloaded"),await a(1e3);let l=[...u];return u=[],l}let d=[];async function f(o,e){let n=s.readFileSync(`./${e}/${o}`,"utf8");t().process(n,{parser:l,from:void 0}).then(o=>{o.root.walkAtRules("font-face",o=>{o.walkDecls("src",o=>{let e=o.value.match(/url\(([^)]+)\)/g);e&&e.forEach(o=>{let e=o.replace(/url\(["']?/,"").replace(/["']?\)/,"");d.push(e)})})})})}async function h(o,e){console.log("--------"),console.log("\uD83D\uDD57 Reading Available Webfonts");let s=`${e}/css`;for(let e of o)await f(e,s);let t=function(){let o=[...d];return d=[],o}();return console.log("✅ Found "+t.length.toString()+" Webfonts"),await a(1e3),t}async function p(o,e,s){let t=`${e}/webfonts`;await c(t),console.log("--------"),console.log("\uD83D\uDD57 Downloading All Webfonts"),await a(1e3);for(let e=0;e<o.length;e++){let l=o[e].replace("..",""),n=`${s}${l}`,a=`[${e+1}/${o.length}]`;await w(n,t,a)}console.log("✅ Webfonts Downloaded")}var m={};async function D(){let o=`https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`;return await fetch(o,{method:"GET"}).then(o=>o.json()).then(o=>(console.log(`\u{2705} Found: v${o.version}`),o)).catch(()=>(console.log(`\u{26D4} Error getting the latest version!`),console.log(`\u{26D4} Forced Using v${n(m).version}`),n(m)))}async function y(){console.log("--------"),console.log("\uD83D\uDD57 Checking Latest Version"),await a(1e3);let o=await D();await a(100),console.log("--------"),await a(1e3),console.log(" "),console.log(`Downloading Version ${o.version} of Font Awesome ${o.version.split(".")[0]} Pro Plus`),await a(1e3),console.log(" "),console.log("--------"),await a(100),console.log("\uD83D\uDD57 Reading Available Stylesheets"),await a(500);let e=o.css.map(e=>`${o.root}/css/${e}`);return console.log("✅ Found "+e.length.toString()+" Sytlesheets"),await a(1e3),{fontlist:e,useVer:o.version,baseUrl:o.root}}async function $(){console.log("Font Awesome Pro Plus Downloader | Devanka761"),await a(500),console.log(""),console.log("--------"),console.log("Font Awesome Pro Plus Downloader was made for educational purposes only!"),await a(100),console.log("--------"),await a(100),console.log("This downloader provides Paid (Pro Plus) Version for the latest Official Package. It is intended for experimental and personal use only. It is licensed for commercial use."),await a(100),console.log("--------"),await a(100),console.log("DO NOT use this downloader if you are not a Creator or you have never buy the official product from the official website."),await a(100),console.log("--------"),await a(100),console.log("To unlock commercial use for your own projects, and get an official product license, please consider to go to the Font Awesome webiste: https://fontawesome.com/plans"),await a(100),console.log("--------"),await a(500);let o=await r("Continue to download? (Y/n) ");o=o?o.toLowerCase():"y";let e=!["no","n","nope"].find(e=>e===o);return console.log(e?"y":"n"),e||(console.log("--------"),await a(1e3),console.log("⛔ Font Awesome Pro Plus Downloader Canceled"),await a(1e3),console.log("DONE")),{isOk:e}}async function b(){await a(100),console.clear();let{isOk:o}=await $();if(!o)return;let{useDir:e}=await i(),{fontlist:s,useVer:t,baseUrl:l}=await y(),n=await g(t,e,s),r=await h(n,e);await p(r,e,l),await a(1e3),console.log("--------"),await a(1e3),console.log(`\u{2705} Font Awesome ${t.split(".")[0]} Pro Plus v${t} Downloaded Successfully!`),await a(1e3),console.log("DONE"),await a(1e3)}m=JSON.parse('{"version":"7.0.0","root":"https://site-assets.fontawesome.com/releases/v7.0.0","css":["fontawesome.css","whiteboard-semibold.css","thumbprint-light.css","slab-press-regular.css","slab-regular.css","sharp-duotone-thin.css","sharp-duotone-solid.css","sharp-duotone-regular.css","sharp-duotone-light.css","sharp-thin.css","sharp-solid.css","sharp-regular.css","sharp-light.css","notdog-duo-solid.css","notdog-solid.css","jelly-fill-regular.css","jelly-duo-regular.css","jelly-regular.css","etch-solid.css","duotone-thin.css","duotone.css","duotone-regular.css","duotone-light.css","thin.css","solid.css","regular.css","light.css","brands.css","chisel-regular.css"]}'),b();
|
|
3
3
|
//# sourceMappingURL=webfapro.js.map
|
package/dist/webfapro.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";A,O,M,O,A,Q,M,U,A,Q,c,C,K,wB,A,Q,M,I,A,Q,M,S,A,Q,M,qB,C,S,E,C,E,O,G,E,U,C,E,O,C,C,CGAe,SAAA,EAAkB,EAAa,GAAG,CAAE,EAAY,CAAC,EAC9D,OAAO,IAAI,QAAQ,AAAC,GAAY,WAAW,EAAS,EAAK,GAC3D,CEAO,SAAS,EAAS,CAAY,EACnC,OAAO,IAAI,QAAQ,AAAC,IAClB,IAAM,EAAK,AAAA,EAAS,eAAe,CAAC,CAClC,MAAO,QAAQ,KAAK,CACpB,OAAQ,QAAQ,MAAM,AACxB,GACA,EAAG,QAAQ,CAAC,EAAM,AAAC,IACjB,EAAQ,GACR,EAAG,KAAK,EACV,EACF,EACF,CDTe,eAAA,IACb,QAAQ,GAAG,CAAC,YACZ,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,KACZ,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,AAAA,EAAM,IAAI,CAAC,iBAAiB,CAAC,CAAC,EACrD,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,YACZ,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,wBAA0B,AAAA,EAAM,IAAI,CAAC,gCAAkC,OAAS,AAAA,EAAM,IAAI,CAAC,cAAgB,KACvH,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,YACZ,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,iEACZ,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,YACZ,IAAM,EAAM,M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E,KAAA,CAAK,CAChB,CX/BA,eAAe,IACb,MAAM,AAAA,EAAS,KACf,QAAQ,KAAK,GACb,GAAM,CAAA,KAAE,CAAI,CAAE,CAAG,MAAM,AAAA,IACvB,GAAI,CAAC,EAAM,OACX,GAAM,CAAA,OAAE,CAAM,CAAE,CAAG,MAAM,AAAA,IACnB,CAAA,SAAE,CAAQ,CAAA,OAAE,CAAM,CAAA,QAAE,CAAO,CAAE,CAAG,MAAM,AAAA,IACtC,EAAoB,MAAM,AAAA,EAAY,EAAQ,EAAQ,GACtD,EAAqB,MAAM,AAAA,EAAU,EAAS,EACpD,OAAM,AAAA,EAAc,EAAU,EAAQ,GACtC,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,YACZ,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,AAAA,EAAM,KAAK,CAAC,CAAC,sBAAe,EAAE,EAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,EAAO,yBAAyB,CAAC,GAC7G,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,AAAA,EAAM,OAAO,CAAC,KAAK,CAAC,mBAChC,MAAM,AAAA,EAAS,IACjB,CUzBA,EAAiB,KAAK,KAAK,CAAC,2pBV8B1B","sources":["<anon>","src/webfapro.ts","src/index.ts","src/helper/waittime.ts","src/pages/askQuestions.ts","src/main/question.ts","src/pages/cssDownload.ts","src/main/file-downloader.ts","src/main/dir-checker.ts","src/pages/fontsDownload.ts","src/main/font-extractor.ts","src/pages/versionCheck.ts","src/json/fonts.json","src/pages/noticeOfficial.ts"],"sourcesContent":["#!/usr/bin/env node\nimport $4BjRV$chalk from \"chalk\";\nimport $4BjRV$readline from \"readline\";\nimport {Downloader as $4BjRV$Downloader} from \"nodejs-file-downloader\";\nimport $4BjRV$fs from \"fs\";\nimport $4BjRV$postcss from \"postcss\";\nimport $4BjRV$postcsssafeparser from \"postcss-safe-parser\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\nvar $1895f9d83a391aec$exports = {};\n\nfunction $574296b1a2de3654$export$2e2bcd8739ae039(ms = 500, n = 5) {\n return new Promise((resolve)=>setTimeout(resolve, ms - n));\n}\n\n\n\n\nfunction $c4dfc35b146d8b69$export$db9f06b5d27d15d8(text) {\n return new Promise((resolve)=>{\n const rl = (0, $4BjRV$readline).createInterface({\n input: process.stdin,\n output: process.stdout\n });\n rl.question(text, (anwer)=>{\n resolve(anwer);\n rl.close();\n });\n });\n}\n\n\n\nasync function $7133ad7cc212004a$export$2e2bcd8739ae039() {\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\" \");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(`Set the ${(0, $4BjRV$chalk).cyan(\"Download Path\")}!`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"Download path can be \" + (0, $4BjRV$chalk).cyan(\"`path/to/your/public/folder`\") + \" or \" + (0, $4BjRV$chalk).cyan(\"`anything`\") + \".\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"if the path does not exist, it will be created automatically.\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(500);\n console.log(\"--------\");\n const dir = await (0, $c4dfc35b146d8b69$export$db9f06b5d27d15d8)(`Enter download path: ${(0, $4BjRV$chalk).bold.cyan(\"(fapro)\")} `);\n const useDir = dir ? dir : \"fapro\";\n console.log((0, $4BjRV$chalk).bold.cyan(`${useDir}`) + `${dir ? \"\" : \" (default)\"}`);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(750);\n console.log(\" \");\n console.log((0, $4BjRV$chalk).bgYellow.black(\" -- Preparing Downloader -- \"));\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(2250);\n console.log(\" \");\n return {\n useDir: useDir\n };\n}\n\n\n\n\n\n\nasync function $a088456a992e1b0b$export$75ad550fa5fe1d36(dirpath) {\n let curpath = \".\";\n const dirs = dirpath.split(\"/\");\n for (const dir of dirs){\n curpath += `/${dir}`;\n if (!(0, $4BjRV$fs).existsSync(curpath)) {\n (0, $4BjRV$fs).mkdirSync(curpath);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n }\n }\n}\n\n\n\nlet $02b0a2fa6f6bedcc$var$filesDownloaded = [];\nasync function $02b0a2fa6f6bedcc$export$bb3b75778e3e272(fileurl, filedir, progress = null) {\n await (0, $a088456a992e1b0b$export$75ad550fa5fe1d36)(`${filedir}`);\n const downloader = new (0, $4BjRV$Downloader)({\n url: fileurl,\n directory: `./${filedir}`,\n cloneFiles: false\n });\n try {\n await downloader.download();\n const fileorigin = fileurl.split(\"/\");\n const filename = fileorigin[fileorigin.length - 1];\n console.log(`\\u{1F680} ${progress ? (0, $4BjRV$chalk).yellow(progress) + \" \" : \"\"}${filename}`);\n $02b0a2fa6f6bedcc$var$filesDownloaded.push(filename);\n } catch (_error) {\n throw new Error((0, $4BjRV$chalk).red(\"The version you wanted to download is not available. Please use other release version.\"));\n }\n}\nfunction $02b0a2fa6f6bedcc$export$8de8b92fd301c83e() {\n const files = [\n ...$02b0a2fa6f6bedcc$var$filesDownloaded\n ];\n $02b0a2fa6f6bedcc$var$filesDownloaded = [];\n return files;\n}\n\n\n\nasync function $50aa263ddf667332$export$2e2bcd8739ae039(useVer, useDir, fontlist) {\n console.log(\"--------\");\n console.log(`\\u{1F557} Downloading All Stylesheets`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n const dir = `${useDir}/css`;\n for(let i = 0; i < fontlist.length; i++){\n const url = fontlist[i];\n const progress = `[${i + 1}/${fontlist.length}]`;\n await (0, $02b0a2fa6f6bedcc$export$bb3b75778e3e272)(url, dir, progress);\n }\n console.log((0, $4BjRV$chalk).greenBright(\"\\u2705 Stylesheets Downloaded\"));\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n return (0, $02b0a2fa6f6bedcc$export$8de8b92fd301c83e)();\n}\n\n\n\n\n\n\n\nlet $4d4643fd90374c00$var$fontUrls = [];\nasync function $4d4643fd90374c00$export$85c953af022fd6f3(filename, filedir) {\n const css = (0, $4BjRV$fs).readFileSync(`./${filedir}/${filename}`, \"utf8\");\n (0, $4BjRV$postcss)().process(css, {\n parser: (0, $4BjRV$postcsssafeparser),\n from: undefined\n }).then((result)=>{\n result.root.walkAtRules(\"font-face\", (rule)=>{\n rule.walkDecls(\"src\", (decl)=>{\n const matches = decl.value.match(/url\\(([^)]+)\\)/g);\n if (matches) matches.forEach((url)=>{\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\");\n $4d4643fd90374c00$var$fontUrls.push(cleanUrl);\n });\n });\n });\n });\n}\nfunction $4d4643fd90374c00$export$cbcfe4007f417765() {\n const fixedFonts = [\n ...$4d4643fd90374c00$var$fontUrls\n ];\n $4d4643fd90374c00$var$fontUrls = [];\n return fixedFonts;\n}\n\n\n\n\nasync function $dc001fcbec17a266$export$ae70b50decb7cf58(sheets, useDir) {\n console.log(\"--------\");\n console.log(\"\\uD83D\\uDD57 Reading Available Webfonts\");\n const dir = `${useDir}/css`;\n for (const sheet of sheets)await (0, $4d4643fd90374c00$export$85c953af022fd6f3)(sheet, dir);\n const fonts = (0, $4d4643fd90374c00$export$cbcfe4007f417765)();\n console.log(\"\\u2705 Found \" + (0, $4BjRV$chalk).green(fonts.length.toString()) + \" Webfonts\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n return fonts;\n}\nasync function $dc001fcbec17a266$export$6c18a7d4cf131851(fonts, filedir, baseUrl) {\n const dir = `${filedir}/webfonts`;\n await (0, $a088456a992e1b0b$export$75ad550fa5fe1d36)(dir);\n const fonturl = baseUrl;\n console.log(\"--------\");\n console.log(\"\\uD83D\\uDD57 Downloading All Webfonts\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n for(let i = 0; i < fonts.length; i++){\n const font = fonts[i].replace(\"..\", \"\");\n const url = `${fonturl}${font}`;\n const progress = `[${i + 1}/${fonts.length}]`;\n await (0, $02b0a2fa6f6bedcc$export$bb3b75778e3e272)(url, dir, progress);\n }\n console.log((0, $4BjRV$chalk).greenBright(\"\\u2705 Webfonts Downloaded\"));\n}\n\n\nvar $eac82631717e0cdb$exports = {};\n$eac82631717e0cdb$exports = JSON.parse(\"{\\\"version\\\":\\\"7.0.0\\\",\\\"root\\\":\\\"https://site-assets.fontawesome.com/releases/v7.0.0\\\",\\\"css\\\":[\\\"fontawesome.css\\\",\\\"whiteboard-semibold.css\\\",\\\"thumbprint-light.css\\\",\\\"slab-press-regular.css\\\",\\\"slab-regular.css\\\",\\\"sharp-duotone-thin.css\\\",\\\"sharp-duotone-solid.css\\\",\\\"sharp-duotone-regular.css\\\",\\\"sharp-duotone-light.css\\\",\\\"sharp-thin.css\\\",\\\"sharp-solid.css\\\",\\\"sharp-regular.css\\\",\\\"sharp-light.css\\\",\\\"notdog-duo-solid.css\\\",\\\"notdog-solid.css\\\",\\\"jelly-fill-regular.css\\\",\\\"jelly-duo-regular.css\\\",\\\"jelly-regular.css\\\",\\\"etch-solid.css\\\",\\\"duotone-thin.css\\\",\\\"duotone.css\\\",\\\"duotone-regular.css\\\",\\\"duotone-light.css\\\",\\\"thin.css\\\",\\\"solid.css\\\",\\\"regular.css\\\",\\\"light.css\\\",\\\"brands.css\\\",\\\"chisel-regular.css\\\"]}\");\n\n\n\n\nasync function $0d221b5cfb1ba63a$var$getVersion() {\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`;\n return await fetch(url, {\n method: \"GET\"\n }).then((res)=>res.json()).then((res)=>{\n console.log(`\\u{2705} Found: v${res.version}`);\n return res;\n }).catch(()=>{\n console.log(`\\u{26D4} Error getting the latest version!`);\n console.log(`\\u{26D4} Forced Using v${(0, (/*@__PURE__*/$parcel$interopDefault($eac82631717e0cdb$exports))).version}`);\n return 0, (/*@__PURE__*/$parcel$interopDefault($eac82631717e0cdb$exports));\n });\n}\nasync function $0d221b5cfb1ba63a$export$2e2bcd8739ae039() {\n console.log(\"--------\");\n console.log(\"\\uD83D\\uDD57 Checking Latest Version\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n const curFonts = await $0d221b5cfb1ba63a$var$getVersion();\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\" \");\n console.log((0, $4BjRV$chalk).bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro Plus -- `));\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\" \");\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"\\uD83D\\uDD57 Reading Available Stylesheets\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(500);\n const fontlist = curFonts.css.map((file)=>`${curFonts.root}/css/${file}`);\n console.log(\"\\u2705 Found \" + (0, $4BjRV$chalk).green(fontlist.length.toString()) + \" Sytlesheets\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n return {\n fontlist: fontlist,\n useVer: curFonts.version,\n baseUrl: curFonts.root\n };\n}\n\n\n\n\n\nasync function $b58e88d9df26e0be$export$2e2bcd8739ae039() {\n console.log((0, $4BjRV$chalk).bgCyan.black(\" -- Font Awesome Pro Plus Downloader | Devanka761 -- \"));\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(500);\n console.log(\"\");\n console.log(\"--------\");\n console.log(`Font Awesome Pro Plus Downloader was made for ${(0, $4BjRV$chalk).yellow(\"educational purposes\")} only!`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(`This downloader provides ${(0, $4BjRV$chalk).bold.green(\"Paid (Pro Plus) Version\")} for the latest Official Package. It is intended for ${(0, $4BjRV$chalk).yellow(\"experimental\")} and ${(0, $4BjRV$chalk).yellow(\"personal use\")} only. It is ${(0, $4BjRV$chalk).red(\"licensed for commercial\")} use.`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(`${(0, $4BjRV$chalk).red(\"DO NOT\")} use this downloader if you are not a ${(0, $4BjRV$chalk).bold.green(\"Creator\")} or you have never buy the official product from the official website.`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the ${(0, $4BjRV$chalk).green(\"Font Awesome\")} webiste: ${(0, $4BjRV$chalk).green(\"https://fontawesome.com/plans\")}`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(500);\n let agree = await (0, $c4dfc35b146d8b69$export$db9f06b5d27d15d8)(`Continue to download? (${(0, $4BjRV$chalk).cyan(\"Y\")}/n) `);\n agree = agree ? agree.toLowerCase() : \"y\";\n const notAgrees = [\n \"no\",\n \"n\",\n \"nope\"\n ];\n const isOk = notAgrees.find((textNo)=>textNo === agree) ? false : true;\n console.log((0, $4BjRV$chalk).cyan(isOk ? \"y\" : \"n\"));\n if (!isOk) {\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log((0, $4BjRV$chalk).red(\"\\u26D4 Font Awesome Pro Plus Downloader Canceled\"));\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log((0, $4BjRV$chalk).bgRed.black(\" --- DONE --- \"));\n }\n return {\n isOk: isOk\n };\n}\n\n\nasync function $0fe9c43b5c368182$var$startDownloader() {\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.clear();\n const { isOk: isOk } = await (0, $b58e88d9df26e0be$export$2e2bcd8739ae039)();\n if (!isOk) return;\n const { useDir: useDir } = await (0, $7133ad7cc212004a$export$2e2bcd8739ae039)();\n const { fontlist: fontlist, useVer: useVer, baseUrl: baseUrl } = await (0, $0d221b5cfb1ba63a$export$2e2bcd8739ae039)();\n const cssUrls = await (0, $50aa263ddf667332$export$2e2bcd8739ae039)(useVer, useDir, fontlist);\n const fontUrls = await (0, $dc001fcbec17a266$export$ae70b50decb7cf58)(cssUrls, useDir);\n await (0, $dc001fcbec17a266$export$6c18a7d4cf131851)(fontUrls, useDir, baseUrl);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log((0, $4BjRV$chalk).green(`\\u{2705} Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`));\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log((0, $4BjRV$chalk).bgGreen.black(\" --- DONE --- \"));\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n}\nfunction $0fe9c43b5c368182$export$c0a0c3a161860b55() {\n $0fe9c43b5c368182$var$startDownloader();\n}\nfunction $0fe9c43b5c368182$export$89ae034f08762d55() {\n $0fe9c43b5c368182$var$startDownloader();\n}\n\n\n(0, $0fe9c43b5c368182$export$89ae034f08762d55)();\n\n\n//# sourceMappingURL=webfapro.js.map\n","#!/usr/bin/env node\nimport { getFapro } from \"./index\"\n\ngetFapro()\n","import chalk from \"chalk\"\nimport waittime from \"./helper/waittime\"\nimport askQuestion from \"./pages/askQuestions\"\nimport cssDownload from \"./pages/cssDownload\"\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\nimport checkVersion from \"./pages/versionCheck\"\nimport unofficialNotice from \"./pages/noticeOfficial\"\n\nasync function startDownloader(): Promise<void> {\n await waittime(100)\n console.clear()\n const { isOk } = await unofficialNotice()\n if (!isOk) return\n const { useDir } = await askQuestion()\n const { fontlist, useVer, baseUrl } = await checkVersion()\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\n await downloadFonts(fontUrls, useDir, baseUrl)\n await waittime(1000)\n console.log(\"--------\")\n await waittime(1000)\n console.log(chalk.green(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`))\n await waittime(1000)\n console.log(chalk.bgGreen.black(\" --- DONE --- \"))\n await waittime(1000)\n}\nexport function getFontAwesomePro(): void {\n startDownloader()\n}\nexport function getFapro(): void {\n startDownloader()\n}\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms - n))\n}\n","import chalk from \"chalk\"\nimport { question } from \"../main/question\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function askQuestion(): Promise<{ useDir: string }> {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n await waittime(100)\n console.log(`Set the ${chalk.cyan(\"Download Path\")}!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"Download path can be \" + chalk.cyan(\"`path/to/your/public/folder`\") + \" or \" + chalk.cyan(\"`anything`\") + \".\")\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"if the path does not exist, it will be created automatically.\")\n await waittime(500)\n console.log(\"--------\")\n const dir = await question(`Enter download path: ${chalk.bold.cyan(\"(fapro)\")} `)\n const useDir = dir ? dir : \"fapro\"\n console.log(chalk.bold.cyan(`${useDir}`) + `${dir ? \"\" : \" (default)\"}`)\n console.log(\"--------\")\n await waittime(750)\n console.log(\" \")\n console.log(chalk.bgYellow.black(\" -- Preparing Downloader -- \"))\n await waittime(2250)\n console.log(\" \")\n return { useDir }\n}\n","import readline from \"readline\"\n\nexport function question(text: string): Promise<string> {\n return new Promise((resolve) => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n rl.question(text, (anwer) => {\n resolve(anwer)\n rl.close()\n })\n })\n}\n","import chalk from \"chalk\"\nimport { downloadFile, getDownloaded } from \"../main/file-downloader\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\n console.log(\"--------\")\n console.log(`🕗 Downloading All Stylesheets`)\n await waittime(1000)\n\n const dir = `${useDir}/css`\n\n for (let i = 0; i < fontlist.length; i++) {\n const url = fontlist[i]\n const progress = `[${i + 1}/${fontlist.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(chalk.greenBright(\"✅ Stylesheets Downloaded\"))\n await waittime(1000)\n return getDownloaded()\n}\n","import { Downloader } from \"nodejs-file-downloader\"\nimport { addDir } from \"./dir-checker\"\nimport chalk from \"chalk\"\n\nlet filesDownloaded: string[] = []\n\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\n await addDir(`${filedir}`)\n const downloader = new Downloader({\n url: fileurl,\n directory: `./${filedir}`,\n cloneFiles: false\n })\n try {\n await downloader.download()\n const fileorigin = fileurl.split(\"/\")\n const filename = fileorigin[fileorigin.length - 1]\n console.log(`🚀 ${progress ? chalk.yellow(progress) + \" \" : \"\"}${filename}`)\n filesDownloaded.push(filename)\n } catch (_error) {\n throw new Error(chalk.red(\"The version you wanted to download is not available. Please use other release version.\"))\n }\n}\nexport function getDownloaded(): string[] {\n const files: string[] = [...filesDownloaded]\n filesDownloaded = []\n return files\n}\n","import fs from \"fs\"\nimport waittime from \"../helper/waittime\"\n\nexport async function addDir(dirpath: string): Promise<void> {\n let curpath = \".\"\n const dirs: string[] = dirpath.split(\"/\")\n\n for (const dir of dirs) {\n curpath += `/${dir}`\n if (!fs.existsSync(curpath)) {\n fs.mkdirSync(curpath)\n await waittime(100)\n }\n }\n}\n","import { addDir } from \"../main/dir-checker\"\nimport waittime from \"../helper/waittime\"\nimport { extractFont, getFonts } from \"../main/font-extractor\"\nimport { downloadFile } from \"../main/file-downloader\"\nimport chalk from \"chalk\"\n\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\n console.log(\"--------\")\n console.log(\"🕗 Reading Available Webfonts\")\n const dir = `${useDir}/css`\n for (const sheet of sheets) {\n await extractFont(sheet, dir)\n }\n const fonts = getFonts()\n console.log(\"✅ Found \" + chalk.green(fonts.length.toString()) + \" Webfonts\")\n await waittime(1000)\n return fonts\n}\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\n const dir = `${filedir}/webfonts`\n await addDir(dir)\n const fonturl = baseUrl\n console.log(\"--------\")\n console.log(\"🕗 Downloading All Webfonts\")\n await waittime(1000)\n for (let i = 0; i < fonts.length; i++) {\n const font = fonts[i].replace(\"..\", \"\")\n const url = `${fonturl}${font}`\n const progress = `[${i + 1}/${fonts.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(chalk.greenBright(\"✅ Webfonts Downloaded\"))\n}\n","import fs from \"fs\"\nimport postcss from \"postcss\"\nimport safeParser from \"postcss-safe-parser\"\n\nlet fontUrls: string[] = []\n\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\n postcss()\n .process(css, { parser: safeParser, from: undefined })\n .then((result) => {\n result.root.walkAtRules(\"font-face\", (rule) => {\n rule.walkDecls(\"src\", (decl) => {\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\n if (matches) {\n matches.forEach((url) => {\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\n fontUrls.push(cleanUrl)\n })\n }\n })\n })\n })\n}\n\nexport function getFonts(): string[] {\n const fixedFonts: string[] = [...fontUrls]\n fontUrls = []\n return fixedFonts\n}\n","import { Ver } from \"./fa.types\"\nimport defVer from \"../json/fonts.json\"\nimport waittime from \"../helper/waittime\"\nimport chalk from \"chalk\"\n\nasync function getVersion(): Promise<Ver> {\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\n\n return await fetch(url, {\n method: \"GET\"\n })\n .then((res) => res.json())\n .then((res) => {\n console.log(`✅ Found: v${res.version}`)\n return res\n })\n .catch(() => {\n console.log(`⛔ Error getting the latest version!`)\n console.log(`⛔ Forced Using v${defVer.version}`)\n return defVer\n })\n}\n\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\n console.log(\"--------\")\n console.log(\"🕗 Checking Latest Version\")\n await waittime(1000)\n const curFonts = await getVersion()\n await waittime(100)\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n console.log(chalk.bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro Plus -- `))\n await waittime(1000)\n console.log(\" \")\n console.log(\"--------\")\n await waittime(100)\n console.log(\"🕗 Reading Available Stylesheets\")\n await waittime(500)\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\n console.log(\"✅ Found \" + chalk.green(fontlist.length.toString()) + \" Sytlesheets\")\n await waittime(1000)\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\n}\n","{ \"version\": \"7.0.0\", \"root\": \"https://site-assets.fontawesome.com/releases/v7.0.0\", \"css\": [\"fontawesome.css\", \"whiteboard-semibold.css\", \"thumbprint-light.css\", \"slab-press-regular.css\", \"slab-regular.css\", \"sharp-duotone-thin.css\", \"sharp-duotone-solid.css\", \"sharp-duotone-regular.css\", \"sharp-duotone-light.css\", \"sharp-thin.css\", \"sharp-solid.css\", \"sharp-regular.css\", \"sharp-light.css\", \"notdog-duo-solid.css\", \"notdog-solid.css\", \"jelly-fill-regular.css\", \"jelly-duo-regular.css\", \"jelly-regular.css\", \"etch-solid.css\", \"duotone-thin.css\", \"duotone.css\", \"duotone-regular.css\", \"duotone-light.css\", \"thin.css\", \"solid.css\", \"regular.css\", \"light.css\", \"brands.css\", \"chisel-regular.css\"] }\n","import chalk from \"chalk\"\nimport waittime from \"../helper/waittime\"\nimport { question } from \"../main/question\"\n\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\n console.log(chalk.bgCyan.black(\" -- Font Awesome Pro Plus Downloader | Devanka761 -- \"))\n await waittime(500)\n console.log(\"\")\n console.log(\"--------\")\n console.log(`Font Awesome Pro Plus Downloader was made for ${chalk.yellow(\"educational purposes\")} only!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`This downloader provides ${chalk.bold.green(\"Paid (Pro Plus) Version\")} for the latest Official Package. It is intended for ${chalk.yellow(\"experimental\")} and ${chalk.yellow(\"personal use\")} only. It is ${chalk.red(\"licensed for commercial\")} use.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`${chalk.red(\"DO NOT\")} use this downloader if you are not a ${chalk.bold.green(\"Creator\")} or you have never buy the official product from the official website.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the ${chalk.green(\"Font Awesome\")} webiste: ${chalk.green(\"https://fontawesome.com/plans\")}`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(500)\n let agree = await question(`Continue to download? (${chalk.cyan(\"Y\")}/n) `)\n agree = agree ? agree.toLowerCase() : \"y\"\n const notAgrees = [\"no\", \"n\", \"nope\"]\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\n console.log(chalk.cyan(isOk ? \"y\" : \"n\"))\n if (!isOk) {\n console.log(\"--------\")\n await waittime(1000)\n console.log(chalk.red(\"⛔ Font Awesome Pro Plus Downloader Canceled\"))\n await waittime(1000)\n console.log(chalk.bgRed.black(\" --- DONE --- \"))\n }\n\n return { isOk }\n}\n"],"names":["$4BjRV$chalk","$4BjRV$readline","Downloader","$4BjRV$Downloader","$4BjRV$fs","$4BjRV$postcss","$4BjRV$postcsssafeparser","$parcel$interopDefault","a","__esModule","default","$574296b1a2de3654$export$2e2bcd8739ae039","ms","n","Promise","resolve","setTimeout","$c4dfc35b146d8b69$export$db9f06b5d27d15d8","text","rl","createInterface","input","process","stdin","output","stdout","question","anwer","close","$7133ad7cc212004a$export$2e2bcd8739ae039","console","log","cyan","dir","bold","useDir","bgYellow","black","$a088456a992e1b0b$export$75ad550fa5fe1d36","dirpath","curpath","split","existsSync","mkdirSync","$02b0a2fa6f6bedcc$var$filesDownloaded","$02b0a2fa6f6bedcc$export$bb3b75778e3e272","fileurl","filedir","progress","downloader","url","directory","cloneFiles","download","fileorigin","filename","length","yellow","push","_error","Error","red","$50aa263ddf667332$export$2e2bcd8739ae039","useVer","fontlist","i","greenBright","files","$4d4643fd90374c00$var$fontUrls","$4d4643fd90374c00$export$85c953af022fd6f3","css","readFileSync","parser","from","undefined","then","result","root","walkAtRules","rule","walkDecls","decl","matches","value","match","forEach","cleanUrl","replace","$dc001fcbec17a266$export$ae70b50decb7cf58","sheets","sheet","fonts","fixedFonts","green","toString","$dc001fcbec17a266$export$6c18a7d4cf131851","baseUrl","font","$eac82631717e0cdb$exports","$0d221b5cfb1ba63a$var$getVersion","Date","now","fetch","method","res","json","version","catch","$0d221b5cfb1ba63a$export$2e2bcd8739ae039","curFonts","bgGreen","map","file","$b58e88d9df26e0be$export$2e2bcd8739ae039","bgCyan","agree","toLowerCase","isOk","notAgrees","find","textNo","bgRed","$0fe9c43b5c368182$var$startDownloader","clear","cssUrls","fontUrls","JSON","parse"],"version":3,"file":"webfapro.js.map","sourceRoot":"../"}
|
|
1
|
+
{"mappings":";A,O,M,U,A,Q,c,C,K,wB,A,Q,M,I,A,Q,M,S,A,Q,M,qB,C,S,E,C,E,O,G,E,U,C,E,O,C,C,CGAe,SAAA,EAAkB,EAAa,GAAG,CAAE,EAAY,CAAC,EAC9D,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AAqB,MAAM,AAAA,EAAU,EAAS,EACpD,OAAM,AAAA,EAAc,EAAU,EAAQ,GACtC,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,YACZ,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,CAAC,sBAAe,EAAE,EAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,EAAO,yBAAyB,CAAC,EACjG,MAAM,AAAA,EAAS,KACf,QAAQ,GAAG,CAAC,QACZ,MAAM,AAAA,EAAS,IACjB,CUxBA,EAAiB,KAAK,KAAK,CAAC,2pBV6B1B","sources":["<anon>","src/webfapro.ts","src/index.ts","src/helper/waittime.ts","src/pages/askQuestions.ts","src/main/question.ts","src/pages/cssDownload.ts","src/main/file-downloader.ts","src/main/dir-checker.ts","src/pages/fontsDownload.ts","src/main/font-extractor.ts","src/pages/versionCheck.ts","src/json/fonts.json","src/pages/noticeOfficial.ts"],"sourcesContent":["#!/usr/bin/env node\nimport $4BjRV$readline from \"readline\";\nimport {Downloader as $4BjRV$Downloader} from \"nodejs-file-downloader\";\nimport $4BjRV$fs from \"fs\";\nimport $4BjRV$postcss from \"postcss\";\nimport $4BjRV$postcsssafeparser from \"postcss-safe-parser\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\nvar $1895f9d83a391aec$exports = {};\nfunction $574296b1a2de3654$export$2e2bcd8739ae039(ms = 500, n = 5) {\n return new Promise((resolve)=>setTimeout(resolve, ms - n));\n}\n\n\n\nfunction $c4dfc35b146d8b69$export$db9f06b5d27d15d8(text) {\n return new Promise((resolve)=>{\n const rl = (0, $4BjRV$readline).createInterface({\n input: process.stdin,\n output: process.stdout\n });\n rl.question(text, (anwer)=>{\n resolve(anwer);\n rl.close();\n });\n });\n}\n\n\n\nasync function $7133ad7cc212004a$export$2e2bcd8739ae039() {\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\" \");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(`Set the Download Path!`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"Download path can be `path/to/your/public/folder` or `anything`.\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"if the path does not exist, it will be created automatically.\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(500);\n console.log(\"--------\");\n const dir = await (0, $c4dfc35b146d8b69$export$db9f06b5d27d15d8)(`Enter download path: (fapro) `);\n const useDir = dir ? dir : \"fapro\";\n console.log(`${useDir}${dir ? \"\" : \" (default)\"}`);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(750);\n console.log(\" \");\n console.log(\"Preparing Downloader\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(2250);\n console.log(\" \");\n return {\n useDir: useDir\n };\n}\n\n\n\n\n\nasync function $a088456a992e1b0b$export$75ad550fa5fe1d36(dirpath) {\n let curpath = \".\";\n const dirs = dirpath.split(\"/\");\n for (const dir of dirs){\n curpath += `/${dir}`;\n if (!(0, $4BjRV$fs).existsSync(curpath)) {\n (0, $4BjRV$fs).mkdirSync(curpath);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n }\n }\n}\n\n\nlet $02b0a2fa6f6bedcc$var$filesDownloaded = [];\nasync function $02b0a2fa6f6bedcc$export$bb3b75778e3e272(fileurl, filedir, progress = null) {\n await (0, $a088456a992e1b0b$export$75ad550fa5fe1d36)(`${filedir}`);\n const downloader = new (0, $4BjRV$Downloader)({\n url: fileurl,\n directory: `./${filedir}`,\n cloneFiles: false\n });\n try {\n await downloader.download();\n const fileorigin = fileurl.split(\"/\");\n const filename = fileorigin[fileorigin.length - 1];\n console.log(`\\u{1F680} ${progress ? progress + \" \" : \"\"}${filename}`);\n $02b0a2fa6f6bedcc$var$filesDownloaded.push(filename);\n } catch (_error) {\n throw new Error(\"The version you wanted to download is not available. Please use other release version.\");\n }\n}\nfunction $02b0a2fa6f6bedcc$export$8de8b92fd301c83e() {\n const files = [\n ...$02b0a2fa6f6bedcc$var$filesDownloaded\n ];\n $02b0a2fa6f6bedcc$var$filesDownloaded = [];\n return files;\n}\n\n\n\nasync function $50aa263ddf667332$export$2e2bcd8739ae039(useVer, useDir, fontlist) {\n console.log(\"--------\");\n console.log(`\\u{1F557} Downloading All Stylesheets`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n const dir = `${useDir}/css`;\n for(let i = 0; i < fontlist.length; i++){\n const url = fontlist[i];\n const progress = `[${i + 1}/${fontlist.length}]`;\n await (0, $02b0a2fa6f6bedcc$export$bb3b75778e3e272)(url, dir, progress);\n }\n console.log(\"\\u2705 Stylesheets Downloaded\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n return (0, $02b0a2fa6f6bedcc$export$8de8b92fd301c83e)();\n}\n\n\n\n\n\n\n\nlet $4d4643fd90374c00$var$fontUrls = [];\nasync function $4d4643fd90374c00$export$85c953af022fd6f3(filename, filedir) {\n const css = (0, $4BjRV$fs).readFileSync(`./${filedir}/${filename}`, \"utf8\");\n (0, $4BjRV$postcss)().process(css, {\n parser: (0, $4BjRV$postcsssafeparser),\n from: undefined\n }).then((result)=>{\n result.root.walkAtRules(\"font-face\", (rule)=>{\n rule.walkDecls(\"src\", (decl)=>{\n const matches = decl.value.match(/url\\(([^)]+)\\)/g);\n if (matches) matches.forEach((url)=>{\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\");\n $4d4643fd90374c00$var$fontUrls.push(cleanUrl);\n });\n });\n });\n });\n}\nfunction $4d4643fd90374c00$export$cbcfe4007f417765() {\n const fixedFonts = [\n ...$4d4643fd90374c00$var$fontUrls\n ];\n $4d4643fd90374c00$var$fontUrls = [];\n return fixedFonts;\n}\n\n\n\nasync function $dc001fcbec17a266$export$ae70b50decb7cf58(sheets, useDir) {\n console.log(\"--------\");\n console.log(\"\\uD83D\\uDD57 Reading Available Webfonts\");\n const dir = `${useDir}/css`;\n for (const sheet of sheets)await (0, $4d4643fd90374c00$export$85c953af022fd6f3)(sheet, dir);\n const fonts = (0, $4d4643fd90374c00$export$cbcfe4007f417765)();\n console.log(\"\\u2705 Found \" + fonts.length.toString() + \" Webfonts\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n return fonts;\n}\nasync function $dc001fcbec17a266$export$6c18a7d4cf131851(fonts, filedir, baseUrl) {\n const dir = `${filedir}/webfonts`;\n await (0, $a088456a992e1b0b$export$75ad550fa5fe1d36)(dir);\n const fonturl = baseUrl;\n console.log(\"--------\");\n console.log(\"\\uD83D\\uDD57 Downloading All Webfonts\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n for(let i = 0; i < fonts.length; i++){\n const font = fonts[i].replace(\"..\", \"\");\n const url = `${fonturl}${font}`;\n const progress = `[${i + 1}/${fonts.length}]`;\n await (0, $02b0a2fa6f6bedcc$export$bb3b75778e3e272)(url, dir, progress);\n }\n console.log(\"\\u2705 Webfonts Downloaded\");\n}\n\n\nvar $eac82631717e0cdb$exports = {};\n$eac82631717e0cdb$exports = JSON.parse(\"{\\\"version\\\":\\\"7.0.0\\\",\\\"root\\\":\\\"https://site-assets.fontawesome.com/releases/v7.0.0\\\",\\\"css\\\":[\\\"fontawesome.css\\\",\\\"whiteboard-semibold.css\\\",\\\"thumbprint-light.css\\\",\\\"slab-press-regular.css\\\",\\\"slab-regular.css\\\",\\\"sharp-duotone-thin.css\\\",\\\"sharp-duotone-solid.css\\\",\\\"sharp-duotone-regular.css\\\",\\\"sharp-duotone-light.css\\\",\\\"sharp-thin.css\\\",\\\"sharp-solid.css\\\",\\\"sharp-regular.css\\\",\\\"sharp-light.css\\\",\\\"notdog-duo-solid.css\\\",\\\"notdog-solid.css\\\",\\\"jelly-fill-regular.css\\\",\\\"jelly-duo-regular.css\\\",\\\"jelly-regular.css\\\",\\\"etch-solid.css\\\",\\\"duotone-thin.css\\\",\\\"duotone.css\\\",\\\"duotone-regular.css\\\",\\\"duotone-light.css\\\",\\\"thin.css\\\",\\\"solid.css\\\",\\\"regular.css\\\",\\\"light.css\\\",\\\"brands.css\\\",\\\"chisel-regular.css\\\"]}\");\n\n\n\nasync function $0d221b5cfb1ba63a$var$getVersion() {\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`;\n return await fetch(url, {\n method: \"GET\"\n }).then((res)=>res.json()).then((res)=>{\n console.log(`\\u{2705} Found: v${res.version}`);\n return res;\n }).catch(()=>{\n console.log(`\\u{26D4} Error getting the latest version!`);\n console.log(`\\u{26D4} Forced Using v${(0, (/*@__PURE__*/$parcel$interopDefault($eac82631717e0cdb$exports))).version}`);\n return 0, (/*@__PURE__*/$parcel$interopDefault($eac82631717e0cdb$exports));\n });\n}\nasync function $0d221b5cfb1ba63a$export$2e2bcd8739ae039() {\n console.log(\"--------\");\n console.log(\"\\uD83D\\uDD57 Checking Latest Version\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n const curFonts = await $0d221b5cfb1ba63a$var$getVersion();\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\" \");\n console.log(`Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro Plus`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\" \");\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"\\uD83D\\uDD57 Reading Available Stylesheets\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(500);\n const fontlist = curFonts.css.map((file)=>`${curFonts.root}/css/${file}`);\n console.log(\"\\u2705 Found \" + fontlist.length.toString() + \" Sytlesheets\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n return {\n fontlist: fontlist,\n useVer: curFonts.version,\n baseUrl: curFonts.root\n };\n}\n\n\n\n\nasync function $b58e88d9df26e0be$export$2e2bcd8739ae039() {\n console.log(\"Font Awesome Pro Plus Downloader | Devanka761\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(500);\n console.log(\"\");\n console.log(\"--------\");\n console.log(`Font Awesome Pro Plus Downloader was made for educational purposes only!`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(`This downloader provides Paid (Pro Plus) Version for the latest Official Package. It is intended for experimental and personal use only. It is licensed for commercial use.`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(`DO NOT use this downloader if you are not a Creator or you have never buy the official product from the official website.`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the Font Awesome webiste: https://fontawesome.com/plans`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(500);\n let agree = await (0, $c4dfc35b146d8b69$export$db9f06b5d27d15d8)(`Continue to download? (Y/n) `);\n agree = agree ? agree.toLowerCase() : \"y\";\n const notAgrees = [\n \"no\",\n \"n\",\n \"nope\"\n ];\n const isOk = notAgrees.find((textNo)=>textNo === agree) ? false : true;\n console.log(isOk ? \"y\" : \"n\");\n if (!isOk) {\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\"\\u26D4 Font Awesome Pro Plus Downloader Canceled\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\"DONE\");\n }\n return {\n isOk: isOk\n };\n}\n\n\nasync function $0fe9c43b5c368182$var$startDownloader() {\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(100);\n console.clear();\n const { isOk: isOk } = await (0, $b58e88d9df26e0be$export$2e2bcd8739ae039)();\n if (!isOk) return;\n const { useDir: useDir } = await (0, $7133ad7cc212004a$export$2e2bcd8739ae039)();\n const { fontlist: fontlist, useVer: useVer, baseUrl: baseUrl } = await (0, $0d221b5cfb1ba63a$export$2e2bcd8739ae039)();\n const cssUrls = await (0, $50aa263ddf667332$export$2e2bcd8739ae039)(useVer, useDir, fontlist);\n const fontUrls = await (0, $dc001fcbec17a266$export$ae70b50decb7cf58)(cssUrls, useDir);\n await (0, $dc001fcbec17a266$export$6c18a7d4cf131851)(fontUrls, useDir, baseUrl);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\"--------\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(`\\u{2705} Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`);\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n console.log(\"DONE\");\n await (0, $574296b1a2de3654$export$2e2bcd8739ae039)(1000);\n}\nfunction $0fe9c43b5c368182$export$c0a0c3a161860b55() {\n $0fe9c43b5c368182$var$startDownloader();\n}\nfunction $0fe9c43b5c368182$export$89ae034f08762d55() {\n $0fe9c43b5c368182$var$startDownloader();\n}\n\n\n(0, $0fe9c43b5c368182$export$89ae034f08762d55)();\n\n\n//# sourceMappingURL=webfapro.js.map\n","#!/usr/bin/env node\nimport { getFapro } from \"./index\"\n\ngetFapro()\n","import waittime from \"./helper/waittime\"\nimport askQuestion from \"./pages/askQuestions\"\nimport cssDownload from \"./pages/cssDownload\"\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\nimport checkVersion from \"./pages/versionCheck\"\nimport unofficialNotice from \"./pages/noticeOfficial\"\n\nasync function startDownloader(): Promise<void> {\n await waittime(100)\n console.clear()\n const { isOk } = await unofficialNotice()\n if (!isOk) return\n const { useDir } = await askQuestion()\n const { fontlist, useVer, baseUrl } = await checkVersion()\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\n await downloadFonts(fontUrls, useDir, baseUrl)\n await waittime(1000)\n console.log(\"--------\")\n await waittime(1000)\n console.log(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro Plus v${useVer} Downloaded Successfully!`)\n await waittime(1000)\n console.log(\"DONE\")\n await waittime(1000)\n}\nexport function getFontAwesomePro(): void {\n startDownloader()\n}\nexport function getFapro(): void {\n startDownloader()\n}\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms - n))\n}\n","import { question } from \"../main/question\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function askQuestion(): Promise<{ useDir: string }> {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n await waittime(100)\n console.log(`Set the Download Path!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"Download path can be \" + \"`path/to/your/public/folder`\" + \" or \" + \"`anything`\" + \".\")\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(\"if the path does not exist, it will be created automatically.\")\n await waittime(500)\n console.log(\"--------\")\n const dir = await question(`Enter download path: (fapro) `)\n const useDir = dir ? dir : \"fapro\"\n console.log(`${useDir}${dir ? \"\" : \" (default)\"}`)\n console.log(\"--------\")\n await waittime(750)\n console.log(\" \")\n console.log(\"Preparing Downloader\")\n await waittime(2250)\n console.log(\" \")\n return { useDir }\n}\n","import readline from \"readline\"\n\nexport function question(text: string): Promise<string> {\n return new Promise((resolve) => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n rl.question(text, (anwer) => {\n resolve(anwer)\n rl.close()\n })\n })\n}\n","import { downloadFile, getDownloaded } from \"../main/file-downloader\"\nimport waittime from \"../helper/waittime\"\n\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\n console.log(\"--------\")\n console.log(`🕗 Downloading All Stylesheets`)\n await waittime(1000)\n\n const dir = `${useDir}/css`\n\n for (let i = 0; i < fontlist.length; i++) {\n const url = fontlist[i]\n const progress = `[${i + 1}/${fontlist.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(\"✅ Stylesheets Downloaded\")\n await waittime(1000)\n return getDownloaded()\n}\n","import { Downloader } from \"nodejs-file-downloader\"\nimport { addDir } from \"./dir-checker\"\n\nlet filesDownloaded: string[] = []\n\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\n await addDir(`${filedir}`)\n const downloader = new Downloader({\n url: fileurl,\n directory: `./${filedir}`,\n cloneFiles: false\n })\n try {\n await downloader.download()\n const fileorigin = fileurl.split(\"/\")\n const filename = fileorigin[fileorigin.length - 1]\n console.log(`🚀 ${progress ? progress + \" \" : \"\"}${filename}`)\n filesDownloaded.push(filename)\n } catch (_error) {\n throw new Error(\"The version you wanted to download is not available. Please use other release version.\")\n }\n}\nexport function getDownloaded(): string[] {\n const files: string[] = [...filesDownloaded]\n filesDownloaded = []\n return files\n}\n","import fs from \"fs\"\nimport waittime from \"../helper/waittime\"\n\nexport async function addDir(dirpath: string): Promise<void> {\n let curpath = \".\"\n const dirs: string[] = dirpath.split(\"/\")\n\n for (const dir of dirs) {\n curpath += `/${dir}`\n if (!fs.existsSync(curpath)) {\n fs.mkdirSync(curpath)\n await waittime(100)\n }\n }\n}\n","import { addDir } from \"../main/dir-checker\"\nimport waittime from \"../helper/waittime\"\nimport { extractFont, getFonts } from \"../main/font-extractor\"\nimport { downloadFile } from \"../main/file-downloader\"\n\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\n console.log(\"--------\")\n console.log(\"🕗 Reading Available Webfonts\")\n const dir = `${useDir}/css`\n for (const sheet of sheets) {\n await extractFont(sheet, dir)\n }\n const fonts = getFonts()\n console.log(\"✅ Found \" + fonts.length.toString() + \" Webfonts\")\n await waittime(1000)\n return fonts\n}\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\n const dir = `${filedir}/webfonts`\n await addDir(dir)\n const fonturl = baseUrl\n console.log(\"--------\")\n console.log(\"🕗 Downloading All Webfonts\")\n await waittime(1000)\n for (let i = 0; i < fonts.length; i++) {\n const font = fonts[i].replace(\"..\", \"\")\n const url = `${fonturl}${font}`\n const progress = `[${i + 1}/${fonts.length}]`\n await downloadFile(url, dir, progress)\n }\n console.log(\"✅ Webfonts Downloaded\")\n}\n","import fs from \"fs\"\nimport postcss from \"postcss\"\nimport safeParser from \"postcss-safe-parser\"\n\nlet fontUrls: string[] = []\n\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\n postcss()\n .process(css, { parser: safeParser, from: undefined })\n .then((result) => {\n result.root.walkAtRules(\"font-face\", (rule) => {\n rule.walkDecls(\"src\", (decl) => {\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\n if (matches) {\n matches.forEach((url) => {\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\n fontUrls.push(cleanUrl)\n })\n }\n })\n })\n })\n}\n\nexport function getFonts(): string[] {\n const fixedFonts: string[] = [...fontUrls]\n fontUrls = []\n return fixedFonts\n}\n","import { Ver } from \"./fa.types\"\nimport defVer from \"../json/fonts.json\"\nimport waittime from \"../helper/waittime\"\n\nasync function getVersion(): Promise<Ver> {\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\n\n return await fetch(url, {\n method: \"GET\"\n })\n .then((res) => res.json())\n .then((res) => {\n console.log(`✅ Found: v${res.version}`)\n return res\n })\n .catch(() => {\n console.log(`⛔ Error getting the latest version!`)\n console.log(`⛔ Forced Using v${defVer.version}`)\n return defVer\n })\n}\n\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\n console.log(\"--------\")\n console.log(\"🕗 Checking Latest Version\")\n await waittime(1000)\n const curFonts = await getVersion()\n await waittime(100)\n console.log(\"--------\")\n await waittime(1000)\n console.log(\" \")\n console.log(`Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro Plus`)\n await waittime(1000)\n console.log(\" \")\n console.log(\"--------\")\n await waittime(100)\n console.log(\"🕗 Reading Available Stylesheets\")\n await waittime(500)\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\n console.log(\"✅ Found \" + fontlist.length.toString() + \" Sytlesheets\")\n await waittime(1000)\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\n}\n","{ \"version\": \"7.0.0\", \"root\": \"https://site-assets.fontawesome.com/releases/v7.0.0\", \"css\": [\"fontawesome.css\", \"whiteboard-semibold.css\", \"thumbprint-light.css\", \"slab-press-regular.css\", \"slab-regular.css\", \"sharp-duotone-thin.css\", \"sharp-duotone-solid.css\", \"sharp-duotone-regular.css\", \"sharp-duotone-light.css\", \"sharp-thin.css\", \"sharp-solid.css\", \"sharp-regular.css\", \"sharp-light.css\", \"notdog-duo-solid.css\", \"notdog-solid.css\", \"jelly-fill-regular.css\", \"jelly-duo-regular.css\", \"jelly-regular.css\", \"etch-solid.css\", \"duotone-thin.css\", \"duotone.css\", \"duotone-regular.css\", \"duotone-light.css\", \"thin.css\", \"solid.css\", \"regular.css\", \"light.css\", \"brands.css\", \"chisel-regular.css\"] }\n","import waittime from \"../helper/waittime\"\nimport { question } from \"../main/question\"\n\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\n console.log(\"Font Awesome Pro Plus Downloader | Devanka761\")\n await waittime(500)\n console.log(\"\")\n console.log(\"--------\")\n console.log(`Font Awesome Pro Plus Downloader was made for educational purposes only!`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`This downloader provides Paid (Pro Plus) Version for the latest Official Package. It is intended for experimental and personal use only. It is licensed for commercial use.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`DO NOT use this downloader if you are not a Creator or you have never buy the official product from the official website.`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(100)\n console.log(`To unlock commercial use for your own projects, and get an official product license, please consider to go to the Font Awesome webiste: https://fontawesome.com/plans`)\n await waittime(100)\n console.log(\"--------\")\n await waittime(500)\n let agree = await question(`Continue to download? (Y/n) `)\n agree = agree ? agree.toLowerCase() : \"y\"\n const notAgrees = [\"no\", \"n\", \"nope\"]\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\n console.log(isOk ? \"y\" : \"n\")\n if (!isOk) {\n console.log(\"--------\")\n await waittime(1000)\n console.log(\"⛔ Font Awesome Pro Plus Downloader Canceled\")\n await waittime(1000)\n console.log(\"DONE\")\n }\n\n return { isOk }\n}\n"],"names":["$4BjRV$readline","Downloader","$4BjRV$Downloader","$4BjRV$fs","$4BjRV$postcss","$4BjRV$postcsssafeparser","$parcel$interopDefault","a","__esModule","default","$574296b1a2de3654$export$2e2bcd8739ae039","ms","n","Promise","resolve","setTimeout","$c4dfc35b146d8b69$export$db9f06b5d27d15d8","text","rl","createInterface","input","process","stdin","output","stdout","question","anwer","close","$7133ad7cc212004a$export$2e2bcd8739ae039","console","log","dir","useDir","$a088456a992e1b0b$export$75ad550fa5fe1d36","dirpath","curpath","split","existsSync","mkdirSync","$02b0a2fa6f6bedcc$var$filesDownloaded","$02b0a2fa6f6bedcc$export$bb3b75778e3e272","fileurl","filedir","progress","downloader","url","directory","cloneFiles","download","fileorigin","filename","length","push","_error","Error","$50aa263ddf667332$export$2e2bcd8739ae039","useVer","fontlist","i","files","$4d4643fd90374c00$var$fontUrls","$4d4643fd90374c00$export$85c953af022fd6f3","css","readFileSync","parser","from","undefined","then","result","root","walkAtRules","rule","walkDecls","decl","matches","value","match","forEach","cleanUrl","replace","$dc001fcbec17a266$export$ae70b50decb7cf58","sheets","sheet","fonts","fixedFonts","toString","$dc001fcbec17a266$export$6c18a7d4cf131851","baseUrl","font","$eac82631717e0cdb$exports","$0d221b5cfb1ba63a$var$getVersion","Date","now","fetch","method","res","json","version","catch","$0d221b5cfb1ba63a$export$2e2bcd8739ae039","curFonts","map","file","$b58e88d9df26e0be$export$2e2bcd8739ae039","agree","toLowerCase","isOk","notAgrees","find","textNo","$0fe9c43b5c368182$var$startDownloader","clear","cssUrls","fontUrls","JSON","parse"],"version":3,"file":"webfapro.js.map","sourceRoot":"../"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webfont-awesome-pro",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "(Webfont) Font Awesome Pro Downloader",
|
|
5
5
|
"author": "Devanka761 <contact@devanka.id> (https://devanka.id/)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -78,7 +78,6 @@
|
|
|
78
78
|
"webfapro": "./dist/webfapro.js"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"chalk": "^5.4.1",
|
|
82
81
|
"nodejs-file-downloader": "^4.13.0",
|
|
83
82
|
"postcss": "^8.5.5",
|
|
84
83
|
"postcss-safe-parser": "^7.0.1"
|