@loybung/launcher 5.4.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +16 -25
- package/package.json +1 -1
package/index.js
CHANGED
@@ -12,31 +12,22 @@ class Launcher {
|
|
12
12
|
setExpire(t) {
|
13
13
|
this.#c = t;
|
14
14
|
}
|
15
|
-
async Run(
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
console.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
throw Error("[- LOYBUNG Launcher -] => Expired!");
|
32
|
-
} catch (r) {
|
33
|
-
console.clear(), t(r), process.exit();
|
34
|
-
}
|
35
|
-
}, 1e3);
|
36
|
-
this.#c || clearInterval(h);
|
37
|
-
} catch (i) {
|
38
|
-
console.clear(), t(i);
|
39
|
-
}
|
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);
|
25
|
+
});
|
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);
|
40
31
|
}
|
41
32
|
}
|
42
33
|
module.exports = { Launcher };
|