webfont-awesome-pro 1.0.0
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 +50 -0
- package/dist/fapro.d.ts +4 -0
- package/dist/fapro.d.ts.map +1 -0
- package/dist/index.cjs +310 -0
- package/dist/index.cjs.map +1 -0
- package/dist/module.mjs +304 -0
- package/dist/module.mjs.map +1 -0
- package/dist/types/helper/waittime.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/main/dir-checker.d.ts +1 -0
- package/dist/types/main/file-downloader.d.ts +2 -0
- package/dist/types/main/font-extractor.d.ts +2 -0
- package/dist/types/main/question.d.ts +1 -0
- package/dist/types/pages/askQuestions.d.ts +3 -0
- package/dist/types/pages/cssDownload.d.ts +1 -0
- package/dist/types/pages/fa.types.d.ts +2 -0
- package/dist/types/pages/fontsDownload.d.ts +2 -0
- package/dist/types/pages/noticeOfficial.d.ts +3 -0
- package/dist/types/pages/versionCheck.d.ts +5 -0
- package/package.json +72 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Font Awesome Pro - Downloader
|
|
2
|
+
|
|
3
|
+
Download the Latest [**Font Awesome Pro**](https://fontawesome.com/) for Free. Get all stylesheets and webfonts into your project easily!
|
|
4
|
+
|
|
5
|
+
- Downloader Version: v1.0.0
|
|
6
|
+
- Font Awesome Pro Version: v7.0.0
|
|
7
|
+
|
|
8
|
+
## NOTICE
|
|
9
|
+
**Font Awesome Pro** Downloader was made for educational purposes only!
|
|
10
|
+
|
|
11
|
+
This downloader provides **Paid version** for the latest official package. It is intended for experimental and **personal use** only. It is **not licensed for commercial** use.
|
|
12
|
+
|
|
13
|
+
To unlock commercial use and get an official product license, please consider to go to the Font Awesome official webiste: https://fontawesome.com/plans
|
|
14
|
+
|
|
15
|
+
## SETUP
|
|
16
|
+
|
|
17
|
+
```shell
|
|
18
|
+
npm install webfont-awesome-pro
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## USAGE
|
|
22
|
+
|
|
23
|
+
#### JavaScript/TypeScript ES Modules - import
|
|
24
|
+
```javascript
|
|
25
|
+
import { getFapro } from "webfont-awesome-pro";
|
|
26
|
+
|
|
27
|
+
// start the downloader
|
|
28
|
+
getFapro();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### JavaScript/TypeScript CommonJS - require
|
|
32
|
+
```javascript
|
|
33
|
+
const { getFapro } = require("webfont-awesome-pro");
|
|
34
|
+
|
|
35
|
+
// start the downloader
|
|
36
|
+
getFapro();
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## QUESTIONS
|
|
40
|
+
|
|
41
|
+
**Download Path Question**
|
|
42
|
+
|
|
43
|
+
Type the path to save the assets. It will makes new directory if does not exist. Leave it empty to use default folder `fapro`.
|
|
44
|
+
|
|
45
|
+
Example: `public/fapro`
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Enter download path: (fapro) public/fapro
|
|
49
|
+
✅ Stylesheets and webfonts will be downloaded to `public/fapro`
|
|
50
|
+
```
|
package/dist/fapro.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AW0BA,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 chalk from \"chalk\"\r\nimport waittime from \"./helper/waittime\"\r\nimport askQuestion from \"./pages/askQuestions\"\r\nimport cssDownload from \"./pages/cssDownload\"\r\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\r\nimport checkVersion from \"./pages/versionCheck\"\r\nimport unofficialNotice from \"./pages/noticeOfficial\"\r\n\r\nasync function startDownloader(): Promise<void> {\r\n await waittime(100)\r\n console.clear()\r\n const { isOk } = await unofficialNotice()\r\n if (!isOk) return\r\n const { useDir } = await askQuestion()\r\n const { fontlist, useVer, baseUrl } = await checkVersion()\r\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\r\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\r\n await downloadFonts(fontUrls, useDir, baseUrl)\r\n await waittime(2000)\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(chalk.green(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro v${useVer} Downloaded Successfully!`))\r\n await waittime(1000)\r\n console.log(chalk.bgGreen.black(\" --- DONE --- \"))\r\n await waittime(2000)\r\n}\r\nexport function getFontAwesomePro(): void {\r\n startDownloader()\r\n}\r\nexport function getFapro(): void {\r\n startDownloader()\r\n}\r\n"],"names":[],"version":3,"file":"fapro.d.ts.map","sourceRoot":"../"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
var $cl6Iw$chalk = require("chalk");
|
|
2
|
+
var $cl6Iw$readline = require("readline");
|
|
3
|
+
var $cl6Iw$nodejsfiledownloader = require("nodejs-file-downloader");
|
|
4
|
+
var $cl6Iw$fs = require("fs");
|
|
5
|
+
var $cl6Iw$postcss = require("postcss");
|
|
6
|
+
var $cl6Iw$postcsssafeparser = require("postcss-safe-parser");
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function $parcel$export(e, n, v, s) {
|
|
14
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$parcel$export(module.exports, "getFontAwesomePro", () => $123f4982a51872b4$export$c0a0c3a161860b55);
|
|
18
|
+
$parcel$export(module.exports, "getFapro", () => $123f4982a51872b4$export$89ae034f08762d55);
|
|
19
|
+
|
|
20
|
+
function $4335f2725be7a2e4$export$2e2bcd8739ae039(ms = 500, n = 5) {
|
|
21
|
+
return new Promise((resolve)=>setTimeout(resolve, ms - n));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function $fd2fccb6528f1018$export$db9f06b5d27d15d8(text) {
|
|
28
|
+
return new Promise((resolve)=>{
|
|
29
|
+
const rl = (0, ($parcel$interopDefault($cl6Iw$readline))).createInterface({
|
|
30
|
+
input: process.stdin,
|
|
31
|
+
output: process.stdout
|
|
32
|
+
});
|
|
33
|
+
rl.question(text, (anwer)=>{
|
|
34
|
+
resolve(anwer);
|
|
35
|
+
rl.close();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
async function $1be43886ff9389d9$export$2e2bcd8739ae039() {
|
|
43
|
+
console.log("--------");
|
|
44
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
45
|
+
console.log(" ");
|
|
46
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
47
|
+
console.log(`Set the ${(0, ($parcel$interopDefault($cl6Iw$chalk))).cyan("Download Path")}!`);
|
|
48
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
49
|
+
console.log("--------");
|
|
50
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
51
|
+
console.log("Download path can be " + (0, ($parcel$interopDefault($cl6Iw$chalk))).cyan("`path/to/your/public/folder`") + " or " + (0, ($parcel$interopDefault($cl6Iw$chalk))).cyan("`anything`") + ".");
|
|
52
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
53
|
+
console.log("--------");
|
|
54
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
55
|
+
console.log("if the path does not exist, it will be created automatically.");
|
|
56
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(500);
|
|
57
|
+
console.log("--------");
|
|
58
|
+
const dir = await (0, $fd2fccb6528f1018$export$db9f06b5d27d15d8)(`Enter download path: ${(0, ($parcel$interopDefault($cl6Iw$chalk))).bold.cyan("(fapro)")} `);
|
|
59
|
+
const useDir = dir ? dir : "fapro";
|
|
60
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).bold.cyan(`${useDir}`) + `${dir ? "" : " (default)"}`);
|
|
61
|
+
console.log("--------");
|
|
62
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(750);
|
|
63
|
+
console.log(" ");
|
|
64
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).bgYellow.black(" -- Preparing Downloader -- "));
|
|
65
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2250);
|
|
66
|
+
console.log(" ");
|
|
67
|
+
return {
|
|
68
|
+
useDir: useDir
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
async function $c3e5cd03b3c41221$export$75ad550fa5fe1d36(dirpath) {
|
|
78
|
+
let curpath = ".";
|
|
79
|
+
const dirs = dirpath.split("/");
|
|
80
|
+
for (const dir of dirs){
|
|
81
|
+
curpath += `/${dir}`;
|
|
82
|
+
if (!(0, ($parcel$interopDefault($cl6Iw$fs))).existsSync(curpath)) {
|
|
83
|
+
(0, ($parcel$interopDefault($cl6Iw$fs))).mkdirSync(curpath);
|
|
84
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
let $27d6a850902385a7$var$filesDownloaded = [];
|
|
92
|
+
async function $27d6a850902385a7$export$bb3b75778e3e272(fileurl, filedir, progress = null) {
|
|
93
|
+
await (0, $c3e5cd03b3c41221$export$75ad550fa5fe1d36)(`${filedir}`);
|
|
94
|
+
const downloader = new (0, $cl6Iw$nodejsfiledownloader.Downloader)({
|
|
95
|
+
url: fileurl,
|
|
96
|
+
directory: `./${filedir}`,
|
|
97
|
+
cloneFiles: false
|
|
98
|
+
});
|
|
99
|
+
try {
|
|
100
|
+
await downloader.download();
|
|
101
|
+
const fileorigin = fileurl.split("/");
|
|
102
|
+
const filename = fileorigin[fileorigin.length - 1];
|
|
103
|
+
console.log(`\u{1F680} ${progress ? (0, ($parcel$interopDefault($cl6Iw$chalk))).yellow(progress) + " " : ""}${filename}`);
|
|
104
|
+
$27d6a850902385a7$var$filesDownloaded.push(filename);
|
|
105
|
+
} catch (_error) {
|
|
106
|
+
throw new Error((0, ($parcel$interopDefault($cl6Iw$chalk))).red("The version you wanted to download is not available. Please use other release version."));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function $27d6a850902385a7$export$8de8b92fd301c83e() {
|
|
110
|
+
const files = [
|
|
111
|
+
...$27d6a850902385a7$var$filesDownloaded
|
|
112
|
+
];
|
|
113
|
+
$27d6a850902385a7$var$filesDownloaded = [];
|
|
114
|
+
return files;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
async function $356121e0811cedf1$export$2e2bcd8739ae039(useVer, useDir, fontlist) {
|
|
120
|
+
console.log("--------");
|
|
121
|
+
console.log(`\u{1F557} Downloading All Stylesheets`);
|
|
122
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2000);
|
|
123
|
+
const dir = `${useDir}/css`;
|
|
124
|
+
for(let i = 0; i < fontlist.length; i++){
|
|
125
|
+
const url = fontlist[i];
|
|
126
|
+
const progress = `[${i + 1}/${fontlist.length}]`;
|
|
127
|
+
await (0, $27d6a850902385a7$export$bb3b75778e3e272)(url, dir, progress);
|
|
128
|
+
}
|
|
129
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).greenBright("\u2705 Stylesheets Downloaded"));
|
|
130
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2000);
|
|
131
|
+
return (0, $27d6a850902385a7$export$8de8b92fd301c83e)();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
let $dee518ee90c6edcc$var$fontUrls = [];
|
|
141
|
+
async function $dee518ee90c6edcc$export$85c953af022fd6f3(filename, filedir) {
|
|
142
|
+
const css = (0, ($parcel$interopDefault($cl6Iw$fs))).readFileSync(`./${filedir}/${filename}`, "utf8");
|
|
143
|
+
(0, ($parcel$interopDefault($cl6Iw$postcss)))().process(css, {
|
|
144
|
+
parser: (0, ($parcel$interopDefault($cl6Iw$postcsssafeparser))),
|
|
145
|
+
from: undefined
|
|
146
|
+
}).then((result)=>{
|
|
147
|
+
result.root.walkAtRules("font-face", (rule)=>{
|
|
148
|
+
rule.walkDecls("src", (decl)=>{
|
|
149
|
+
const matches = decl.value.match(/url\(([^)]+)\)/g);
|
|
150
|
+
if (matches) matches.forEach((url)=>{
|
|
151
|
+
const cleanUrl = url.replace(/url\(["']?/, "").replace(/["']?\)/, "");
|
|
152
|
+
$dee518ee90c6edcc$var$fontUrls.push(cleanUrl);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function $dee518ee90c6edcc$export$cbcfe4007f417765() {
|
|
159
|
+
const fixedFonts = [
|
|
160
|
+
...$dee518ee90c6edcc$var$fontUrls
|
|
161
|
+
];
|
|
162
|
+
$dee518ee90c6edcc$var$fontUrls = [];
|
|
163
|
+
return fixedFonts;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
async function $7348ac6bfe35f15e$export$ae70b50decb7cf58(sheets, useDir) {
|
|
170
|
+
console.log("--------");
|
|
171
|
+
console.log("\uD83D\uDD57 Reading Available Webfonts");
|
|
172
|
+
const dir = `${useDir}/css`;
|
|
173
|
+
for (const sheet of sheets)await (0, $dee518ee90c6edcc$export$85c953af022fd6f3)(sheet, dir);
|
|
174
|
+
const fonts = (0, $dee518ee90c6edcc$export$cbcfe4007f417765)();
|
|
175
|
+
console.log("\u2705 Found " + (0, ($parcel$interopDefault($cl6Iw$chalk))).green(fonts.length.toString()) + " Webfonts");
|
|
176
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2000);
|
|
177
|
+
return fonts;
|
|
178
|
+
}
|
|
179
|
+
async function $7348ac6bfe35f15e$export$6c18a7d4cf131851(fonts, filedir, baseUrl) {
|
|
180
|
+
const dir = `${filedir}/webfonts`;
|
|
181
|
+
await (0, $c3e5cd03b3c41221$export$75ad550fa5fe1d36)(dir);
|
|
182
|
+
const fonturl = baseUrl;
|
|
183
|
+
console.log("--------");
|
|
184
|
+
console.log("\uD83D\uDD57 Downloading All Webfonts");
|
|
185
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2000);
|
|
186
|
+
for(let i = 0; i < fonts.length; i++){
|
|
187
|
+
const font = fonts[i].replace("..", "");
|
|
188
|
+
const url = `${fonturl}${font}`;
|
|
189
|
+
const progress = `[${i + 1}/${fonts.length}]`;
|
|
190
|
+
await (0, $27d6a850902385a7$export$bb3b75778e3e272)(url, dir, progress);
|
|
191
|
+
}
|
|
192
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).greenBright("\u2705 Webfonts Downloaded"));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
var $76e709583c343c63$exports = {};
|
|
197
|
+
$76e709583c343c63$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\"]}");
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
async function $b5a14f8b420f5894$var$getVersion() {
|
|
203
|
+
const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`;
|
|
204
|
+
return await fetch(url, {
|
|
205
|
+
method: "GET"
|
|
206
|
+
}).then((res)=>res.json()).then((res)=>{
|
|
207
|
+
console.log(`\u{2705} Found: v${res.version}`);
|
|
208
|
+
return res;
|
|
209
|
+
}).catch(()=>{
|
|
210
|
+
console.log(`\u{26D4} Error getting the latest version!`);
|
|
211
|
+
console.log(`\u{26D4} Forced Using v${(0, (/*@__PURE__*/$parcel$interopDefault($76e709583c343c63$exports))).version}`);
|
|
212
|
+
return 0, (/*@__PURE__*/$parcel$interopDefault($76e709583c343c63$exports));
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
async function $b5a14f8b420f5894$export$2e2bcd8739ae039() {
|
|
216
|
+
console.log("--------");
|
|
217
|
+
console.log("\uD83D\uDD57 Checking Latest Version");
|
|
218
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
219
|
+
const curFonts = await $b5a14f8b420f5894$var$getVersion();
|
|
220
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
221
|
+
console.log("--------");
|
|
222
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
223
|
+
console.log(" ");
|
|
224
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(".")[0]} Pro -- `));
|
|
225
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
226
|
+
console.log(" ");
|
|
227
|
+
console.log("--------");
|
|
228
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
229
|
+
console.log("\uD83D\uDD57 Reading Available Stylesheets");
|
|
230
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(500);
|
|
231
|
+
const fontlist = curFonts.css.map((file)=>`${curFonts.root}/css/${file}`);
|
|
232
|
+
console.log("\u2705 Found " + (0, ($parcel$interopDefault($cl6Iw$chalk))).green(fontlist.length.toString()) + " Sytlesheets");
|
|
233
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2000);
|
|
234
|
+
return {
|
|
235
|
+
fontlist: fontlist,
|
|
236
|
+
useVer: curFonts.version,
|
|
237
|
+
baseUrl: curFonts.root
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
async function $4eef5e371b281461$export$2e2bcd8739ae039() {
|
|
246
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).bgCyan.black(" -- Font Awesome Pro Downloader | Devanka761 -- "));
|
|
247
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(500);
|
|
248
|
+
console.log("");
|
|
249
|
+
console.log("--------");
|
|
250
|
+
console.log(`Font Awesome Pro Downloader was made for ${(0, ($parcel$interopDefault($cl6Iw$chalk))).yellow("educational purposes")} only!`);
|
|
251
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
252
|
+
console.log("--------");
|
|
253
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
254
|
+
console.log(`This downloader provides ${(0, ($parcel$interopDefault($cl6Iw$chalk))).bold.green("Paid version")} for the latest Official Package. It is intended for ${(0, ($parcel$interopDefault($cl6Iw$chalk))).yellow("experimental")} and ${(0, ($parcel$interopDefault($cl6Iw$chalk))).yellow("personal use")} only. It is ${(0, ($parcel$interopDefault($cl6Iw$chalk))).red("not licensed")} for commercial use.`);
|
|
255
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
256
|
+
console.log("--------");
|
|
257
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
258
|
+
console.log(`To unlock commercial use and get an official product license, please consider to go to the ${(0, ($parcel$interopDefault($cl6Iw$chalk))).green("Font Awesome")} webiste: ${(0, ($parcel$interopDefault($cl6Iw$chalk))).green("https://fontawesome.com/plans")}`);
|
|
259
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
260
|
+
console.log("--------");
|
|
261
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(500);
|
|
262
|
+
let agree = await (0, $fd2fccb6528f1018$export$db9f06b5d27d15d8)(`Continue to download? (${(0, ($parcel$interopDefault($cl6Iw$chalk))).cyan("Y")}/n) `);
|
|
263
|
+
agree = agree ? agree.toLowerCase() : "y";
|
|
264
|
+
const notAgrees = [
|
|
265
|
+
"no",
|
|
266
|
+
"n",
|
|
267
|
+
"nope"
|
|
268
|
+
];
|
|
269
|
+
const isOk = notAgrees.find((textNo)=>textNo === agree) ? false : true;
|
|
270
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).cyan(isOk ? "y" : "n"));
|
|
271
|
+
if (!isOk) {
|
|
272
|
+
console.log("--------");
|
|
273
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
274
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).red("\u26D4 Font Awesome Pro Downloader Canceled"));
|
|
275
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
276
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).bgRed.black(" --- DONE --- "));
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
isOk: isOk
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
async function $123f4982a51872b4$var$startDownloader() {
|
|
285
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(100);
|
|
286
|
+
console.clear();
|
|
287
|
+
const { isOk: isOk } = await (0, $4eef5e371b281461$export$2e2bcd8739ae039)();
|
|
288
|
+
if (!isOk) return;
|
|
289
|
+
const { useDir: useDir } = await (0, $1be43886ff9389d9$export$2e2bcd8739ae039)();
|
|
290
|
+
const { fontlist: fontlist, useVer: useVer, baseUrl: baseUrl } = await (0, $b5a14f8b420f5894$export$2e2bcd8739ae039)();
|
|
291
|
+
const cssUrls = await (0, $356121e0811cedf1$export$2e2bcd8739ae039)(useVer, useDir, fontlist);
|
|
292
|
+
const fontUrls = await (0, $7348ac6bfe35f15e$export$ae70b50decb7cf58)(cssUrls, useDir);
|
|
293
|
+
await (0, $7348ac6bfe35f15e$export$6c18a7d4cf131851)(fontUrls, useDir, baseUrl);
|
|
294
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2000);
|
|
295
|
+
console.log("--------");
|
|
296
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
297
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).green(`\u{2705} Font Awesome ${useVer.split(".")[0]} Pro v${useVer} Downloaded Successfully!`));
|
|
298
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(1000);
|
|
299
|
+
console.log((0, ($parcel$interopDefault($cl6Iw$chalk))).bgGreen.black(" --- DONE --- "));
|
|
300
|
+
await (0, $4335f2725be7a2e4$export$2e2bcd8739ae039)(2000);
|
|
301
|
+
}
|
|
302
|
+
function $123f4982a51872b4$export$c0a0c3a161860b55() {
|
|
303
|
+
$123f4982a51872b4$var$startDownloader();
|
|
304
|
+
}
|
|
305
|
+
function $123f4982a51872b4$export$89ae034f08762d55() {
|
|
306
|
+
$123f4982a51872b4$var$startDownloader();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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,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;;;;ADTe;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,QAAQ,EAAE,CAAA,GAAA,sCAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACrD,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,0BAA0B,CAAA,GAAA,sCAAI,EAAE,IAAI,CAAC,kCAAkC,SAAS,CAAA,GAAA,sCAAI,EAAE,IAAI,CAAC,gBAAgB;IACvH,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,C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AAQ,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,CAAA,GAAA,sCAAI,EAAE,KAAK,CAAC,CAAC,sBAAe,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,yBAAyB,CAAC;IACxG,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\"\r\nimport waittime from \"./helper/waittime\"\r\nimport askQuestion from \"./pages/askQuestions\"\r\nimport cssDownload from \"./pages/cssDownload\"\r\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\r\nimport checkVersion from \"./pages/versionCheck\"\r\nimport unofficialNotice from \"./pages/noticeOfficial\"\r\n\r\nasync function startDownloader(): Promise<void> {\r\n await waittime(100)\r\n console.clear()\r\n const { isOk } = await unofficialNotice()\r\n if (!isOk) return\r\n const { useDir } = await askQuestion()\r\n const { fontlist, useVer, baseUrl } = await checkVersion()\r\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\r\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\r\n await downloadFonts(fontUrls, useDir, baseUrl)\r\n await waittime(2000)\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(chalk.green(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro v${useVer} Downloaded Successfully!`))\r\n await waittime(1000)\r\n console.log(chalk.bgGreen.black(\" --- DONE --- \"))\r\n await waittime(2000)\r\n}\r\nexport function getFontAwesomePro(): void {\r\n startDownloader()\r\n}\r\nexport function getFapro(): void {\r\n startDownloader()\r\n}\r\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\r\n return new Promise((resolve) => setTimeout(resolve, ms - n))\r\n}\r\n","import chalk from \"chalk\"\r\nimport { question } from \"../main/question\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport default async function askQuestion(): Promise<{ useDir: string }> {\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(\" \")\r\n await waittime(100)\r\n console.log(`Set the ${chalk.cyan(\"Download Path\")}!`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"Download path can be \" + chalk.cyan(\"`path/to/your/public/folder`\") + \" or \" + chalk.cyan(\"`anything`\") + \".\")\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"if the path does not exist, it will be created automatically.\")\r\n await waittime(500)\r\n console.log(\"--------\")\r\n const dir = await question(`Enter download path: ${chalk.bold.cyan(\"(fapro)\")} `)\r\n const useDir = dir ? dir : \"fapro\"\r\n console.log(chalk.bold.cyan(`${useDir}`) + `${dir ? \"\" : \" (default)\"}`)\r\n console.log(\"--------\")\r\n await waittime(750)\r\n console.log(\" \")\r\n console.log(chalk.bgYellow.black(\" -- Preparing Downloader -- \"))\r\n await waittime(2250)\r\n console.log(\" \")\r\n return { useDir }\r\n}\r\n","import readline from \"readline\"\r\n\r\nexport function question(text: string): Promise<string> {\r\n return new Promise((resolve) => {\r\n const rl = readline.createInterface({\r\n input: process.stdin,\r\n output: process.stdout\r\n })\r\n rl.question(text, (anwer) => {\r\n resolve(anwer)\r\n rl.close()\r\n })\r\n })\r\n}\r\n","import chalk from \"chalk\"\r\nimport { downloadFile, getDownloaded } from \"../main/file-downloader\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\r\n console.log(\"--------\")\r\n console.log(`🕗 Downloading All Stylesheets`)\r\n await waittime(2000)\r\n\r\n const dir = `${useDir}/css`\r\n\r\n for (let i = 0; i < fontlist.length; i++) {\r\n const url = fontlist[i]\r\n const progress = `[${i + 1}/${fontlist.length}]`\r\n await downloadFile(url, dir, progress)\r\n }\r\n console.log(chalk.greenBright(\"✅ Stylesheets Downloaded\"))\r\n await waittime(2000)\r\n return getDownloaded()\r\n}\r\n","import { Downloader } from \"nodejs-file-downloader\"\r\nimport { addDir } from \"./dir-checker\"\r\nimport chalk from \"chalk\"\r\n\r\nlet filesDownloaded: string[] = []\r\n\r\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\r\n await addDir(`${filedir}`)\r\n const downloader = new Downloader({\r\n url: fileurl,\r\n directory: `./${filedir}`,\r\n cloneFiles: false\r\n })\r\n try {\r\n await downloader.download()\r\n const fileorigin = fileurl.split(\"/\")\r\n const filename = fileorigin[fileorigin.length - 1]\r\n console.log(`🚀 ${progress ? chalk.yellow(progress) + \" \" : \"\"}${filename}`)\r\n filesDownloaded.push(filename)\r\n } catch (_error) {\r\n throw new Error(chalk.red(\"The version you wanted to download is not available. Please use other release version.\"))\r\n }\r\n}\r\nexport function getDownloaded(): string[] {\r\n const files: string[] = [...filesDownloaded]\r\n filesDownloaded = []\r\n return files\r\n}\r\n","import fs from \"fs\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport async function addDir(dirpath: string): Promise<void> {\r\n let curpath = \".\"\r\n const dirs: string[] = dirpath.split(\"/\")\r\n\r\n for (const dir of dirs) {\r\n curpath += `/${dir}`\r\n if (!fs.existsSync(curpath)) {\r\n fs.mkdirSync(curpath)\r\n await waittime(100)\r\n }\r\n }\r\n}\r\n","import { addDir } from \"../main/dir-checker\"\r\nimport waittime from \"../helper/waittime\"\r\nimport { extractFont, getFonts } from \"../main/font-extractor\"\r\nimport { downloadFile } from \"../main/file-downloader\"\r\nimport chalk from \"chalk\"\r\n\r\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\r\n console.log(\"--------\")\r\n console.log(\"🕗 Reading Available Webfonts\")\r\n const dir = `${useDir}/css`\r\n for (const sheet of sheets) {\r\n await extractFont(sheet, dir)\r\n }\r\n const fonts = getFonts()\r\n console.log(\"✅ Found \" + chalk.green(fonts.length.toString()) + \" Webfonts\")\r\n await waittime(2000)\r\n return fonts\r\n}\r\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\r\n const dir = `${filedir}/webfonts`\r\n await addDir(dir)\r\n const fonturl = baseUrl\r\n console.log(\"--------\")\r\n console.log(\"🕗 Downloading All Webfonts\")\r\n await waittime(2000)\r\n for (let i = 0; i < fonts.length; i++) {\r\n const font = fonts[i].replace(\"..\", \"\")\r\n const url = `${fonturl}${font}`\r\n const progress = `[${i + 1}/${fonts.length}]`\r\n await downloadFile(url, dir, progress)\r\n }\r\n console.log(chalk.greenBright(\"✅ Webfonts Downloaded\"))\r\n}\r\n","import fs from \"fs\"\r\nimport postcss from \"postcss\"\r\nimport safeParser from \"postcss-safe-parser\"\r\n\r\nlet fontUrls: string[] = []\r\n\r\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\r\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\r\n postcss()\r\n .process(css, { parser: safeParser, from: undefined })\r\n .then((result) => {\r\n result.root.walkAtRules(\"font-face\", (rule) => {\r\n rule.walkDecls(\"src\", (decl) => {\r\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\r\n if (matches) {\r\n matches.forEach((url) => {\r\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\r\n fontUrls.push(cleanUrl)\r\n })\r\n }\r\n })\r\n })\r\n })\r\n}\r\n\r\nexport function getFonts(): string[] {\r\n const fixedFonts: string[] = [...fontUrls]\r\n fontUrls = []\r\n return fixedFonts\r\n}\r\n","import { Ver } from \"./fa.types\"\r\nimport defVer from \"../json/fonts.json\"\r\nimport waittime from \"../helper/waittime\"\r\nimport chalk from \"chalk\"\r\n\r\nasync function getVersion(): Promise<Ver> {\r\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\r\n\r\n return await fetch(url, {\r\n method: \"GET\"\r\n })\r\n .then((res) => res.json())\r\n .then((res) => {\r\n console.log(`✅ Found: v${res.version}`)\r\n return res\r\n })\r\n .catch(() => {\r\n console.log(`⛔ Error getting the latest version!`)\r\n console.log(`⛔ Forced Using v${defVer.version}`)\r\n return defVer\r\n })\r\n}\r\n\r\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\r\n console.log(\"--------\")\r\n console.log(\"🕗 Checking Latest Version\")\r\n await waittime(1000)\r\n const curFonts = await getVersion()\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(\" \")\r\n console.log(chalk.bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro -- `))\r\n await waittime(1000)\r\n console.log(\" \")\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"🕗 Reading Available Stylesheets\")\r\n await waittime(500)\r\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\r\n console.log(\"✅ Found \" + chalk.green(fontlist.length.toString()) + \" Sytlesheets\")\r\n await waittime(2000)\r\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\r\n}\r\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\"] }\r\n","import chalk from \"chalk\"\r\nimport waittime from \"../helper/waittime\"\r\nimport { question } from \"../main/question\"\r\n\r\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\r\n console.log(chalk.bgCyan.black(\" -- Font Awesome Pro Downloader | Devanka761 -- \"))\r\n await waittime(500)\r\n console.log(\"\")\r\n console.log(\"--------\")\r\n console.log(`Font Awesome Pro Downloader was made for ${chalk.yellow(\"educational purposes\")} only!`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(`This downloader provides ${chalk.bold.green(\"Paid version\")} for the latest Official Package. It is intended for ${chalk.yellow(\"experimental\")} and ${chalk.yellow(\"personal use\")} only. It is ${chalk.red(\"not licensed\")} for commercial use.`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(`To unlock commercial use and get an official product license, please consider to go to the ${chalk.green(\"Font Awesome\")} webiste: ${chalk.green(\"https://fontawesome.com/plans\")}`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(500)\r\n let agree = await question(`Continue to download? (${chalk.cyan(\"Y\")}/n) `)\r\n agree = agree ? agree.toLowerCase() : \"y\"\r\n const notAgrees = [\"no\", \"n\", \"nope\"]\r\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\r\n console.log(chalk.cyan(isOk ? \"y\" : \"n\"))\r\n if (!isOk) {\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(chalk.red(\"⛔ Font Awesome Pro Downloader Canceled\"))\r\n await waittime(1000)\r\n console.log(chalk.bgRed.black(\" --- DONE --- \"))\r\n }\r\n\r\n return { isOk }\r\n}\r\n"],"names":[],"version":3,"file":"index.cjs.map","sourceRoot":"../"}
|
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import $hSjDC$chalk from "chalk";
|
|
2
|
+
import $hSjDC$readline from "readline";
|
|
3
|
+
import {Downloader as $hSjDC$Downloader} from "nodejs-file-downloader";
|
|
4
|
+
import $hSjDC$fs from "fs";
|
|
5
|
+
import $hSjDC$postcss from "postcss";
|
|
6
|
+
import $hSjDC$postcsssafeparser from "postcss-safe-parser";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function $a777439b98e3ff1b$export$2e2bcd8739ae039(ms = 500, n = 5) {
|
|
14
|
+
return new Promise((resolve)=>setTimeout(resolve, ms - n));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function $eb80b25db258156d$export$db9f06b5d27d15d8(text) {
|
|
21
|
+
return new Promise((resolve)=>{
|
|
22
|
+
const rl = (0, $hSjDC$readline).createInterface({
|
|
23
|
+
input: process.stdin,
|
|
24
|
+
output: process.stdout
|
|
25
|
+
});
|
|
26
|
+
rl.question(text, (anwer)=>{
|
|
27
|
+
resolve(anwer);
|
|
28
|
+
rl.close();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
async function $1208536e777ab3f1$export$2e2bcd8739ae039() {
|
|
36
|
+
console.log("--------");
|
|
37
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
38
|
+
console.log(" ");
|
|
39
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
40
|
+
console.log(`Set the ${(0, $hSjDC$chalk).cyan("Download Path")}!`);
|
|
41
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
42
|
+
console.log("--------");
|
|
43
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
44
|
+
console.log("Download path can be " + (0, $hSjDC$chalk).cyan("`path/to/your/public/folder`") + " or " + (0, $hSjDC$chalk).cyan("`anything`") + ".");
|
|
45
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
46
|
+
console.log("--------");
|
|
47
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
48
|
+
console.log("if the path does not exist, it will be created automatically.");
|
|
49
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(500);
|
|
50
|
+
console.log("--------");
|
|
51
|
+
const dir = await (0, $eb80b25db258156d$export$db9f06b5d27d15d8)(`Enter download path: ${(0, $hSjDC$chalk).bold.cyan("(fapro)")} `);
|
|
52
|
+
const useDir = dir ? dir : "fapro";
|
|
53
|
+
console.log((0, $hSjDC$chalk).bold.cyan(`${useDir}`) + `${dir ? "" : " (default)"}`);
|
|
54
|
+
console.log("--------");
|
|
55
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(750);
|
|
56
|
+
console.log(" ");
|
|
57
|
+
console.log((0, $hSjDC$chalk).bgYellow.black(" -- Preparing Downloader -- "));
|
|
58
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2250);
|
|
59
|
+
console.log(" ");
|
|
60
|
+
return {
|
|
61
|
+
useDir: useDir
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
async function $fb617e32957cfdd1$export$75ad550fa5fe1d36(dirpath) {
|
|
71
|
+
let curpath = ".";
|
|
72
|
+
const dirs = dirpath.split("/");
|
|
73
|
+
for (const dir of dirs){
|
|
74
|
+
curpath += `/${dir}`;
|
|
75
|
+
if (!(0, $hSjDC$fs).existsSync(curpath)) {
|
|
76
|
+
(0, $hSjDC$fs).mkdirSync(curpath);
|
|
77
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
let $79f93e09d37d22af$var$filesDownloaded = [];
|
|
85
|
+
async function $79f93e09d37d22af$export$bb3b75778e3e272(fileurl, filedir, progress = null) {
|
|
86
|
+
await (0, $fb617e32957cfdd1$export$75ad550fa5fe1d36)(`${filedir}`);
|
|
87
|
+
const downloader = new (0, $hSjDC$Downloader)({
|
|
88
|
+
url: fileurl,
|
|
89
|
+
directory: `./${filedir}`,
|
|
90
|
+
cloneFiles: false
|
|
91
|
+
});
|
|
92
|
+
try {
|
|
93
|
+
await downloader.download();
|
|
94
|
+
const fileorigin = fileurl.split("/");
|
|
95
|
+
const filename = fileorigin[fileorigin.length - 1];
|
|
96
|
+
console.log(`\u{1F680} ${progress ? (0, $hSjDC$chalk).yellow(progress) + " " : ""}${filename}`);
|
|
97
|
+
$79f93e09d37d22af$var$filesDownloaded.push(filename);
|
|
98
|
+
} catch (_error) {
|
|
99
|
+
throw new Error((0, $hSjDC$chalk).red("The version you wanted to download is not available. Please use other release version."));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function $79f93e09d37d22af$export$8de8b92fd301c83e() {
|
|
103
|
+
const files = [
|
|
104
|
+
...$79f93e09d37d22af$var$filesDownloaded
|
|
105
|
+
];
|
|
106
|
+
$79f93e09d37d22af$var$filesDownloaded = [];
|
|
107
|
+
return files;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
async function $ccfdb89c88d6a2d0$export$2e2bcd8739ae039(useVer, useDir, fontlist) {
|
|
113
|
+
console.log("--------");
|
|
114
|
+
console.log(`\u{1F557} Downloading All Stylesheets`);
|
|
115
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2000);
|
|
116
|
+
const dir = `${useDir}/css`;
|
|
117
|
+
for(let i = 0; i < fontlist.length; i++){
|
|
118
|
+
const url = fontlist[i];
|
|
119
|
+
const progress = `[${i + 1}/${fontlist.length}]`;
|
|
120
|
+
await (0, $79f93e09d37d22af$export$bb3b75778e3e272)(url, dir, progress);
|
|
121
|
+
}
|
|
122
|
+
console.log((0, $hSjDC$chalk).greenBright("\u2705 Stylesheets Downloaded"));
|
|
123
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2000);
|
|
124
|
+
return (0, $79f93e09d37d22af$export$8de8b92fd301c83e)();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
let $1ffd869ab3f86381$var$fontUrls = [];
|
|
134
|
+
async function $1ffd869ab3f86381$export$85c953af022fd6f3(filename, filedir) {
|
|
135
|
+
const css = (0, $hSjDC$fs).readFileSync(`./${filedir}/${filename}`, "utf8");
|
|
136
|
+
(0, $hSjDC$postcss)().process(css, {
|
|
137
|
+
parser: (0, $hSjDC$postcsssafeparser),
|
|
138
|
+
from: undefined
|
|
139
|
+
}).then((result)=>{
|
|
140
|
+
result.root.walkAtRules("font-face", (rule)=>{
|
|
141
|
+
rule.walkDecls("src", (decl)=>{
|
|
142
|
+
const matches = decl.value.match(/url\(([^)]+)\)/g);
|
|
143
|
+
if (matches) matches.forEach((url)=>{
|
|
144
|
+
const cleanUrl = url.replace(/url\(["']?/, "").replace(/["']?\)/, "");
|
|
145
|
+
$1ffd869ab3f86381$var$fontUrls.push(cleanUrl);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function $1ffd869ab3f86381$export$cbcfe4007f417765() {
|
|
152
|
+
const fixedFonts = [
|
|
153
|
+
...$1ffd869ab3f86381$var$fontUrls
|
|
154
|
+
];
|
|
155
|
+
$1ffd869ab3f86381$var$fontUrls = [];
|
|
156
|
+
return fixedFonts;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
async function $9ff909d4a69662c1$export$ae70b50decb7cf58(sheets, useDir) {
|
|
163
|
+
console.log("--------");
|
|
164
|
+
console.log("\uD83D\uDD57 Reading Available Webfonts");
|
|
165
|
+
const dir = `${useDir}/css`;
|
|
166
|
+
for (const sheet of sheets)await (0, $1ffd869ab3f86381$export$85c953af022fd6f3)(sheet, dir);
|
|
167
|
+
const fonts = (0, $1ffd869ab3f86381$export$cbcfe4007f417765)();
|
|
168
|
+
console.log("\u2705 Found " + (0, $hSjDC$chalk).green(fonts.length.toString()) + " Webfonts");
|
|
169
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2000);
|
|
170
|
+
return fonts;
|
|
171
|
+
}
|
|
172
|
+
async function $9ff909d4a69662c1$export$6c18a7d4cf131851(fonts, filedir, baseUrl) {
|
|
173
|
+
const dir = `${filedir}/webfonts`;
|
|
174
|
+
await (0, $fb617e32957cfdd1$export$75ad550fa5fe1d36)(dir);
|
|
175
|
+
const fonturl = baseUrl;
|
|
176
|
+
console.log("--------");
|
|
177
|
+
console.log("\uD83D\uDD57 Downloading All Webfonts");
|
|
178
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2000);
|
|
179
|
+
for(let i = 0; i < fonts.length; i++){
|
|
180
|
+
const font = fonts[i].replace("..", "");
|
|
181
|
+
const url = `${fonturl}${font}`;
|
|
182
|
+
const progress = `[${i + 1}/${fonts.length}]`;
|
|
183
|
+
await (0, $79f93e09d37d22af$export$bb3b75778e3e272)(url, dir, progress);
|
|
184
|
+
}
|
|
185
|
+
console.log((0, $hSjDC$chalk).greenBright("\u2705 Webfonts Downloaded"));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
var $2fec5fa9afe64cbe$exports = {};
|
|
190
|
+
$2fec5fa9afe64cbe$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\"]}");
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
async function $6057a7b12f1c52d2$var$getVersion() {
|
|
196
|
+
const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`;
|
|
197
|
+
return await fetch(url, {
|
|
198
|
+
method: "GET"
|
|
199
|
+
}).then((res)=>res.json()).then((res)=>{
|
|
200
|
+
console.log(`\u{2705} Found: v${res.version}`);
|
|
201
|
+
return res;
|
|
202
|
+
}).catch(()=>{
|
|
203
|
+
console.log(`\u{26D4} Error getting the latest version!`);
|
|
204
|
+
console.log(`\u{26D4} Forced Using v${(0, (/*@__PURE__*/$parcel$interopDefault($2fec5fa9afe64cbe$exports))).version}`);
|
|
205
|
+
return 0, (/*@__PURE__*/$parcel$interopDefault($2fec5fa9afe64cbe$exports));
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
async function $6057a7b12f1c52d2$export$2e2bcd8739ae039() {
|
|
209
|
+
console.log("--------");
|
|
210
|
+
console.log("\uD83D\uDD57 Checking Latest Version");
|
|
211
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
212
|
+
const curFonts = await $6057a7b12f1c52d2$var$getVersion();
|
|
213
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
214
|
+
console.log("--------");
|
|
215
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
216
|
+
console.log(" ");
|
|
217
|
+
console.log((0, $hSjDC$chalk).bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(".")[0]} Pro -- `));
|
|
218
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
219
|
+
console.log(" ");
|
|
220
|
+
console.log("--------");
|
|
221
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
222
|
+
console.log("\uD83D\uDD57 Reading Available Stylesheets");
|
|
223
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(500);
|
|
224
|
+
const fontlist = curFonts.css.map((file)=>`${curFonts.root}/css/${file}`);
|
|
225
|
+
console.log("\u2705 Found " + (0, $hSjDC$chalk).green(fontlist.length.toString()) + " Sytlesheets");
|
|
226
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2000);
|
|
227
|
+
return {
|
|
228
|
+
fontlist: fontlist,
|
|
229
|
+
useVer: curFonts.version,
|
|
230
|
+
baseUrl: curFonts.root
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
async function $763cbf9c5fe61a09$export$2e2bcd8739ae039() {
|
|
239
|
+
console.log((0, $hSjDC$chalk).bgCyan.black(" -- Font Awesome Pro Downloader | Devanka761 -- "));
|
|
240
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(500);
|
|
241
|
+
console.log("");
|
|
242
|
+
console.log("--------");
|
|
243
|
+
console.log(`Font Awesome Pro Downloader was made for ${(0, $hSjDC$chalk).yellow("educational purposes")} only!`);
|
|
244
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
245
|
+
console.log("--------");
|
|
246
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
247
|
+
console.log(`This downloader provides ${(0, $hSjDC$chalk).bold.green("Paid version")} for the latest Official Package. It is intended for ${(0, $hSjDC$chalk).yellow("experimental")} and ${(0, $hSjDC$chalk).yellow("personal use")} only. It is ${(0, $hSjDC$chalk).red("not licensed")} for commercial use.`);
|
|
248
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
249
|
+
console.log("--------");
|
|
250
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
251
|
+
console.log(`To unlock commercial use and get an official product license, please consider to go to the ${(0, $hSjDC$chalk).green("Font Awesome")} webiste: ${(0, $hSjDC$chalk).green("https://fontawesome.com/plans")}`);
|
|
252
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
253
|
+
console.log("--------");
|
|
254
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(500);
|
|
255
|
+
let agree = await (0, $eb80b25db258156d$export$db9f06b5d27d15d8)(`Continue to download? (${(0, $hSjDC$chalk).cyan("Y")}/n) `);
|
|
256
|
+
agree = agree ? agree.toLowerCase() : "y";
|
|
257
|
+
const notAgrees = [
|
|
258
|
+
"no",
|
|
259
|
+
"n",
|
|
260
|
+
"nope"
|
|
261
|
+
];
|
|
262
|
+
const isOk = notAgrees.find((textNo)=>textNo === agree) ? false : true;
|
|
263
|
+
console.log((0, $hSjDC$chalk).cyan(isOk ? "y" : "n"));
|
|
264
|
+
if (!isOk) {
|
|
265
|
+
console.log("--------");
|
|
266
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
267
|
+
console.log((0, $hSjDC$chalk).red("\u26D4 Font Awesome Pro Downloader Canceled"));
|
|
268
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
269
|
+
console.log((0, $hSjDC$chalk).bgRed.black(" --- DONE --- "));
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
isOk: isOk
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
async function $eb17f609fec572d7$var$startDownloader() {
|
|
278
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(100);
|
|
279
|
+
console.clear();
|
|
280
|
+
const { isOk: isOk } = await (0, $763cbf9c5fe61a09$export$2e2bcd8739ae039)();
|
|
281
|
+
if (!isOk) return;
|
|
282
|
+
const { useDir: useDir } = await (0, $1208536e777ab3f1$export$2e2bcd8739ae039)();
|
|
283
|
+
const { fontlist: fontlist, useVer: useVer, baseUrl: baseUrl } = await (0, $6057a7b12f1c52d2$export$2e2bcd8739ae039)();
|
|
284
|
+
const cssUrls = await (0, $ccfdb89c88d6a2d0$export$2e2bcd8739ae039)(useVer, useDir, fontlist);
|
|
285
|
+
const fontUrls = await (0, $9ff909d4a69662c1$export$ae70b50decb7cf58)(cssUrls, useDir);
|
|
286
|
+
await (0, $9ff909d4a69662c1$export$6c18a7d4cf131851)(fontUrls, useDir, baseUrl);
|
|
287
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2000);
|
|
288
|
+
console.log("--------");
|
|
289
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
290
|
+
console.log((0, $hSjDC$chalk).green(`\u{2705} Font Awesome ${useVer.split(".")[0]} Pro v${useVer} Downloaded Successfully!`));
|
|
291
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(1000);
|
|
292
|
+
console.log((0, $hSjDC$chalk).bgGreen.black(" --- DONE --- "));
|
|
293
|
+
await (0, $a777439b98e3ff1b$export$2e2bcd8739ae039)(2000);
|
|
294
|
+
}
|
|
295
|
+
function $eb17f609fec572d7$export$c0a0c3a161860b55() {
|
|
296
|
+
$eb17f609fec572d7$var$startDownloader();
|
|
297
|
+
}
|
|
298
|
+
function $eb17f609fec572d7$export$89ae034f08762d55() {
|
|
299
|
+
$eb17f609fec572d7$var$startDownloader();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
export {$eb17f609fec572d7$export$c0a0c3a161860b55 as getFontAwesomePro, $eb17f609fec572d7$export$89ae034f08762d55 as getFapro};
|
|
304
|
+
//# sourceMappingURL=module.mjs.map
|
|
@@ -0,0 +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;;;;ADTe;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,QAAQ,EAAE,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACrD,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC;IACZ,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,0BAA0B,CAAA,GAAA,YA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AAM,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,CAAA,GAAA,YAAI,EAAE,KAAK,CAAC,CAAC,sBAAe,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,yBAAyB,CAAC;IACxG,MAAM,CAAA,GAAA,wCAAO,EAAE;IACf,QAAQ,GAAG,CAAC,CAAA,GAAA,YAAI,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\"\r\nimport waittime from \"./helper/waittime\"\r\nimport askQuestion from \"./pages/askQuestions\"\r\nimport cssDownload from \"./pages/cssDownload\"\r\nimport { downloadFonts, readFonts } from \"./pages/fontsDownload\"\r\nimport checkVersion from \"./pages/versionCheck\"\r\nimport unofficialNotice from \"./pages/noticeOfficial\"\r\n\r\nasync function startDownloader(): Promise<void> {\r\n await waittime(100)\r\n console.clear()\r\n const { isOk } = await unofficialNotice()\r\n if (!isOk) return\r\n const { useDir } = await askQuestion()\r\n const { fontlist, useVer, baseUrl } = await checkVersion()\r\n const cssUrls: string[] = await cssDownload(useVer, useDir, fontlist)\r\n const fontUrls: string[] = await readFonts(cssUrls, useDir)\r\n await downloadFonts(fontUrls, useDir, baseUrl)\r\n await waittime(2000)\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(chalk.green(`✅ Font Awesome ${useVer.split(\".\")[0]} Pro v${useVer} Downloaded Successfully!`))\r\n await waittime(1000)\r\n console.log(chalk.bgGreen.black(\" --- DONE --- \"))\r\n await waittime(2000)\r\n}\r\nexport function getFontAwesomePro(): void {\r\n startDownloader()\r\n}\r\nexport function getFapro(): void {\r\n startDownloader()\r\n}\r\n","export default function waittime(ms: number = 500, n: number = 5): Promise<void> {\r\n return new Promise((resolve) => setTimeout(resolve, ms - n))\r\n}\r\n","import chalk from \"chalk\"\r\nimport { question } from \"../main/question\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport default async function askQuestion(): Promise<{ useDir: string }> {\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(\" \")\r\n await waittime(100)\r\n console.log(`Set the ${chalk.cyan(\"Download Path\")}!`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"Download path can be \" + chalk.cyan(\"`path/to/your/public/folder`\") + \" or \" + chalk.cyan(\"`anything`\") + \".\")\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"if the path does not exist, it will be created automatically.\")\r\n await waittime(500)\r\n console.log(\"--------\")\r\n const dir = await question(`Enter download path: ${chalk.bold.cyan(\"(fapro)\")} `)\r\n const useDir = dir ? dir : \"fapro\"\r\n console.log(chalk.bold.cyan(`${useDir}`) + `${dir ? \"\" : \" (default)\"}`)\r\n console.log(\"--------\")\r\n await waittime(750)\r\n console.log(\" \")\r\n console.log(chalk.bgYellow.black(\" -- Preparing Downloader -- \"))\r\n await waittime(2250)\r\n console.log(\" \")\r\n return { useDir }\r\n}\r\n","import readline from \"readline\"\r\n\r\nexport function question(text: string): Promise<string> {\r\n return new Promise((resolve) => {\r\n const rl = readline.createInterface({\r\n input: process.stdin,\r\n output: process.stdout\r\n })\r\n rl.question(text, (anwer) => {\r\n resolve(anwer)\r\n rl.close()\r\n })\r\n })\r\n}\r\n","import chalk from \"chalk\"\r\nimport { downloadFile, getDownloaded } from \"../main/file-downloader\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport default async function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]> {\r\n console.log(\"--------\")\r\n console.log(`🕗 Downloading All Stylesheets`)\r\n await waittime(2000)\r\n\r\n const dir = `${useDir}/css`\r\n\r\n for (let i = 0; i < fontlist.length; i++) {\r\n const url = fontlist[i]\r\n const progress = `[${i + 1}/${fontlist.length}]`\r\n await downloadFile(url, dir, progress)\r\n }\r\n console.log(chalk.greenBright(\"✅ Stylesheets Downloaded\"))\r\n await waittime(2000)\r\n return getDownloaded()\r\n}\r\n","import { Downloader } from \"nodejs-file-downloader\"\r\nimport { addDir } from \"./dir-checker\"\r\nimport chalk from \"chalk\"\r\n\r\nlet filesDownloaded: string[] = []\r\n\r\nexport async function downloadFile(fileurl: string, filedir: string, progress: string | null = null): Promise<void> {\r\n await addDir(`${filedir}`)\r\n const downloader = new Downloader({\r\n url: fileurl,\r\n directory: `./${filedir}`,\r\n cloneFiles: false\r\n })\r\n try {\r\n await downloader.download()\r\n const fileorigin = fileurl.split(\"/\")\r\n const filename = fileorigin[fileorigin.length - 1]\r\n console.log(`🚀 ${progress ? chalk.yellow(progress) + \" \" : \"\"}${filename}`)\r\n filesDownloaded.push(filename)\r\n } catch (_error) {\r\n throw new Error(chalk.red(\"The version you wanted to download is not available. Please use other release version.\"))\r\n }\r\n}\r\nexport function getDownloaded(): string[] {\r\n const files: string[] = [...filesDownloaded]\r\n filesDownloaded = []\r\n return files\r\n}\r\n","import fs from \"fs\"\r\nimport waittime from \"../helper/waittime\"\r\n\r\nexport async function addDir(dirpath: string): Promise<void> {\r\n let curpath = \".\"\r\n const dirs: string[] = dirpath.split(\"/\")\r\n\r\n for (const dir of dirs) {\r\n curpath += `/${dir}`\r\n if (!fs.existsSync(curpath)) {\r\n fs.mkdirSync(curpath)\r\n await waittime(100)\r\n }\r\n }\r\n}\r\n","import { addDir } from \"../main/dir-checker\"\r\nimport waittime from \"../helper/waittime\"\r\nimport { extractFont, getFonts } from \"../main/font-extractor\"\r\nimport { downloadFile } from \"../main/file-downloader\"\r\nimport chalk from \"chalk\"\r\n\r\nexport async function readFonts(sheets: string[], useDir: string): Promise<string[]> {\r\n console.log(\"--------\")\r\n console.log(\"🕗 Reading Available Webfonts\")\r\n const dir = `${useDir}/css`\r\n for (const sheet of sheets) {\r\n await extractFont(sheet, dir)\r\n }\r\n const fonts = getFonts()\r\n console.log(\"✅ Found \" + chalk.green(fonts.length.toString()) + \" Webfonts\")\r\n await waittime(2000)\r\n return fonts\r\n}\r\nexport async function downloadFonts(fonts: string[], filedir: string, baseUrl: string): Promise<void> {\r\n const dir = `${filedir}/webfonts`\r\n await addDir(dir)\r\n const fonturl = baseUrl\r\n console.log(\"--------\")\r\n console.log(\"🕗 Downloading All Webfonts\")\r\n await waittime(2000)\r\n for (let i = 0; i < fonts.length; i++) {\r\n const font = fonts[i].replace(\"..\", \"\")\r\n const url = `${fonturl}${font}`\r\n const progress = `[${i + 1}/${fonts.length}]`\r\n await downloadFile(url, dir, progress)\r\n }\r\n console.log(chalk.greenBright(\"✅ Webfonts Downloaded\"))\r\n}\r\n","import fs from \"fs\"\r\nimport postcss from \"postcss\"\r\nimport safeParser from \"postcss-safe-parser\"\r\n\r\nlet fontUrls: string[] = []\r\n\r\nexport async function extractFont(filename: string, filedir: string): Promise<void> {\r\n const css = fs.readFileSync(`./${filedir}/${filename}`, \"utf8\")\r\n postcss()\r\n .process(css, { parser: safeParser, from: undefined })\r\n .then((result) => {\r\n result.root.walkAtRules(\"font-face\", (rule) => {\r\n rule.walkDecls(\"src\", (decl) => {\r\n const matches = decl.value.match(/url\\(([^)]+)\\)/g)\r\n if (matches) {\r\n matches.forEach((url) => {\r\n const cleanUrl = url.replace(/url\\([\"']?/, \"\").replace(/[\"']?\\)/, \"\")\r\n fontUrls.push(cleanUrl)\r\n })\r\n }\r\n })\r\n })\r\n })\r\n}\r\n\r\nexport function getFonts(): string[] {\r\n const fixedFonts: string[] = [...fontUrls]\r\n fontUrls = []\r\n return fixedFonts\r\n}\r\n","import { Ver } from \"./fa.types\"\r\nimport defVer from \"../json/fonts.json\"\r\nimport waittime from \"../helper/waittime\"\r\nimport chalk from \"chalk\"\r\n\r\nasync function getVersion(): Promise<Ver> {\r\n const url = `https://raw.githubusercontent.com/devanka761/webfont-awesome-pro/refs/heads/master/src/json/fonts.json?ts=${Date.now().toString(36)}`\r\n\r\n return await fetch(url, {\r\n method: \"GET\"\r\n })\r\n .then((res) => res.json())\r\n .then((res) => {\r\n console.log(`✅ Found: v${res.version}`)\r\n return res\r\n })\r\n .catch(() => {\r\n console.log(`⛔ Error getting the latest version!`)\r\n console.log(`⛔ Forced Using v${defVer.version}`)\r\n return defVer\r\n })\r\n}\r\n\r\nexport default async function checkVersion(): Promise<{ fontlist: string[]; useVer: string; baseUrl: string }> {\r\n console.log(\"--------\")\r\n console.log(\"🕗 Checking Latest Version\")\r\n await waittime(1000)\r\n const curFonts = await getVersion()\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(\" \")\r\n console.log(chalk.bgGreen.black(` -- Downloading Version ${curFonts.version} of Font Awesome ${curFonts.version.split(\".\")[0]} Pro -- `))\r\n await waittime(1000)\r\n console.log(\" \")\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(\"🕗 Reading Available Stylesheets\")\r\n await waittime(500)\r\n const fontlist = curFonts.css.map((file) => `${curFonts.root}/css/${file}`)\r\n console.log(\"✅ Found \" + chalk.green(fontlist.length.toString()) + \" Sytlesheets\")\r\n await waittime(2000)\r\n return { fontlist, useVer: curFonts.version, baseUrl: curFonts.root }\r\n}\r\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\"] }\r\n","import chalk from \"chalk\"\r\nimport waittime from \"../helper/waittime\"\r\nimport { question } from \"../main/question\"\r\n\r\nexport default async function unofficialNotice(): Promise<{ isOk: boolean }> {\r\n console.log(chalk.bgCyan.black(\" -- Font Awesome Pro Downloader | Devanka761 -- \"))\r\n await waittime(500)\r\n console.log(\"\")\r\n console.log(\"--------\")\r\n console.log(`Font Awesome Pro Downloader was made for ${chalk.yellow(\"educational purposes\")} only!`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(`This downloader provides ${chalk.bold.green(\"Paid version\")} for the latest Official Package. It is intended for ${chalk.yellow(\"experimental\")} and ${chalk.yellow(\"personal use\")} only. It is ${chalk.red(\"not licensed\")} for commercial use.`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(100)\r\n console.log(`To unlock commercial use and get an official product license, please consider to go to the ${chalk.green(\"Font Awesome\")} webiste: ${chalk.green(\"https://fontawesome.com/plans\")}`)\r\n await waittime(100)\r\n console.log(\"--------\")\r\n await waittime(500)\r\n let agree = await question(`Continue to download? (${chalk.cyan(\"Y\")}/n) `)\r\n agree = agree ? agree.toLowerCase() : \"y\"\r\n const notAgrees = [\"no\", \"n\", \"nope\"]\r\n const isOk = notAgrees.find((textNo) => textNo === agree) ? false : true\r\n console.log(chalk.cyan(isOk ? \"y\" : \"n\"))\r\n if (!isOk) {\r\n console.log(\"--------\")\r\n await waittime(1000)\r\n console.log(chalk.red(\"⛔ Font Awesome Pro Downloader Canceled\"))\r\n await waittime(1000)\r\n console.log(chalk.bgRed.black(\" --- DONE --- \"))\r\n }\r\n\r\n return { isOk }\r\n}\r\n"],"names":[],"version":3,"file":"module.mjs.map","sourceRoot":"../"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function waittime(ms?: number, n?: number): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addDir(dirpath: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function question(text: string): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function cssDownload(useVer: string, useDir: string, fontlist: string[]): Promise<string[]>;
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "webfont-awesome-pro",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "(Webfont) Font Awesome Pro Downloader",
|
|
5
|
+
"author": "Devanka761 <contact@devanka.id> (https://devanka.id/)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/devanka761/webfont-awesome-pro.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/devanka761/webfont-awesome-pro/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/devanka761/webfont-awesome-pro#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"font-awesome-pro", "fontawesomepro", "font-awesome", "fontawesome", "font-awesome-pro-downloader", "font-awesome-downloader", "font", "webfont", "font-face"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/fapro.d.ts",
|
|
23
|
+
"default": "./dist/module.mjs"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/fapro.d.ts",
|
|
27
|
+
"default": "./dist/index.cjs"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"main": "dist/index.cjs",
|
|
32
|
+
"module": "dist/module.mjs",
|
|
33
|
+
"types": "dist/fapro.d.ts",
|
|
34
|
+
"files": [
|
|
35
|
+
"dist/"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=14"
|
|
39
|
+
},
|
|
40
|
+
"targets": {
|
|
41
|
+
"types": {},
|
|
42
|
+
"module": {},
|
|
43
|
+
"main": {}
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"lint": "eslint --ext .ts && npm run check",
|
|
47
|
+
"check": "tsc --noEmit",
|
|
48
|
+
"start": "tsx ./src/local.ts",
|
|
49
|
+
"clear": "rm -rf dist .parcel-cache",
|
|
50
|
+
"build": "rm -rf dist .parcel-cache && tsc --emitDeclarationOnly && parcel build src/index.ts",
|
|
51
|
+
"prepublishOnly": "npm run build"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"chalk": "^5.4.1",
|
|
55
|
+
"nodejs-file-downloader": "^4.13.0",
|
|
56
|
+
"postcss": "^8.5.5",
|
|
57
|
+
"postcss-safe-parser": "^7.0.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@eslint/js": "^9.28.0",
|
|
61
|
+
"@parcel/packager-ts": "^2.15.4",
|
|
62
|
+
"@parcel/transformer-typescript-types": "^2.15.4",
|
|
63
|
+
"@types/node": "^24.0.8",
|
|
64
|
+
"@types/postcss-safe-parser": "^5.0.4",
|
|
65
|
+
"parcel": "^2.15.4",
|
|
66
|
+
"prettier": "^3.5.3",
|
|
67
|
+
"ts-node": "^10.9.2",
|
|
68
|
+
"tsx": "^4.20.2",
|
|
69
|
+
"typescript": "^5.8.3",
|
|
70
|
+
"typescript-eslint": "^8.34.0"
|
|
71
|
+
}
|
|
72
|
+
}
|