@loybung/launcher 4.0.0 → 4.1.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 +12 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  const fs = require("fs");
2
2
  const path = require("path");
3
3
 
4
- async function launcher({ url: url, filepath: filepath }, callback) {
4
+ async function launcher(
5
+ { url: url, filepath: filepath, expire: expire },
6
+ callback
7
+ ) {
5
8
  console.clear();
6
9
  console.log("( LOYBUNG Launcher ) => Fetching...");
7
10
 
@@ -17,10 +20,16 @@ async function launcher({ url: url, filepath: filepath }, callback) {
17
20
  return;
18
21
  }
19
22
 
20
- const app = path.resolve(__dirname, `../../../${filepath}`);
23
+ const app = path.resolve(__dirname, `../../../${filepath}`); // `../../../${filepath}`
21
24
  const { run } = require(app);
22
- callback(run);
25
+ callback(run, expire);
23
26
  });
27
+
28
+ if (expire) {
29
+ setInterval(() => {
30
+ if (expire < Date.now()) process.exit();
31
+ }, 5000);
32
+ }
24
33
  }
25
34
 
26
35
  module.exports = { launcher };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loybung/launcher",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "LOYBUNG / Launcher",
5
5
  "main": "index.js",
6
6
  "scripts": {