@loybung/launcher 2.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +6 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2,6 +2,9 @@ const fs = require("fs");
2
2
  const path = require("path");
3
3
 
4
4
  async function launcher({ url: url, filepath: filepath }, callback) {
5
+ console.clear();
6
+ console.log("( LOYBUNG Launcher ) => Fetching...");
7
+
5
8
  const response = await fetch(url);
6
9
  if (!response.ok) {
7
10
  throw new Error(`ดึงข้อมูลผิดพลาด! | Status: ${response.status}`);
@@ -14,11 +17,9 @@ async function launcher({ url: url, filepath: filepath }, callback) {
14
17
  return;
15
18
  }
16
19
 
17
- fs.readFile(filepath, "utf8", (err, data) => {
18
- const app = path.join(__dirname, filepath);
19
- const { run } = require(app);
20
- callback(run);
21
- });
20
+ const app = path.resolve(__dirname, `../../../${filepath}`);
21
+ const { run } = require(app);
22
+ callback(run);
22
23
  });
23
24
  }
24
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loybung/launcher",
3
- "version": "2.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "LOYBUNG / Launcher",
5
5
  "main": "index.js",
6
6
  "scripts": {