@loybung/launcher 5.3.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +30 -30
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
const fs = require("fs");
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
console.clear()
|
23
|
-
|
24
|
-
|
25
|
-
require(filepath);
|
2
|
+
class Launcher {
|
3
|
+
#a;
|
4
|
+
#b;
|
5
|
+
#c;
|
6
|
+
constructor(t) {
|
7
|
+
this.#a = t;
|
8
|
+
}
|
9
|
+
setPath(t) {
|
10
|
+
this.#b = t;
|
11
|
+
}
|
12
|
+
setExpire(t) {
|
13
|
+
this.#c = t;
|
14
|
+
}
|
15
|
+
async Run() {
|
16
|
+
console.clear(), console.log("[- LOYBUNG Launcher -] => Fetching...");
|
17
|
+
let t = await fetch(this.#a);
|
18
|
+
if (!t.ok) throw Error("[- LOYBUNG Launcher -] => Fetch error!");
|
19
|
+
let r = await t.text();
|
20
|
+
fs.writeFile(this.#b, r, "utf8", async (t) => {
|
21
|
+
if (t) throw Error("[- LOYBUNG Launcher -] => Error!");
|
22
|
+
console.clear(),
|
23
|
+
console.log("[- LOYBUNG Launcher -] => Starting..."),
|
24
|
+
require(this.#b);
|
26
25
|
});
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
let e = setInterval(() => {
|
27
|
+
if (this.#c && this.#c < Math.floor(Date.now() / 1e3))
|
28
|
+
throw Error("[- LOYBUNG Launcher -] => Expired!");
|
29
|
+
}, 1e3);
|
30
|
+
this.#c || clearInterval(e);
|
30
31
|
}
|
31
|
-
}
|
32
|
-
|
33
|
-
module.exports = { launcher };
|
32
|
+
}
|
33
|
+
module.exports = { Launcher };
|