@k3000/s1 0.2.7 → 0.3.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/bin.mjs CHANGED
@@ -66,6 +66,7 @@ function init(override) {
66
66
  myCopyFn('index.mjs', 'index.mjs', override)
67
67
  myCopyFn('files/package.json', 'package.json', override)
68
68
  myCopyFn('files/package.bin.json', 'package.bin.json', override)
69
+ myCopyFn('files/pm2.mjs', 'pm2.mjs', override)
69
70
 
70
71
  pm2.save()
71
72
 
package/common/pm2.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import {execSync} from 'node:child_process'
2
+ import {execSync, exec} from 'node:child_process'
3
3
 
4
4
  class PM2 {
5
5
 
@@ -16,13 +16,16 @@ class PM2 {
16
16
  }
17
17
 
18
18
  /**
19
- *
20
19
  * @param {string} command
20
+ * @param {Boolean} sync
21
21
  */
22
- exec(command) {
22
+ exec(command, sync = true) {
23
23
 
24
24
  console.log(' > ' + command)
25
25
 
26
+ if (!sync) return exec(command, {windowsHide: true},
27
+ error => console.error(error))
28
+
26
29
  const string = execSync(command).toString()
27
30
 
28
31
  return {
@@ -142,4 +145,4 @@ class PM2 {
142
145
  }
143
146
  }
144
147
 
145
- export const pm2 = new PM2()
148
+ export const pm2 = new PM2()
package/files/pm2.mjs ADDED
@@ -0,0 +1,6 @@
1
+ import {pm2} from "./common/pm2.mjs";
2
+
3
+ pm2.exec('node --experimental-vm-modules admin.mjs', false)
4
+ pm2.exec('node --experimental-vm-modules jwt.mjs', false)
5
+ pm2.exec('node --experimental-vm-modules store1.mjs', false)
6
+ pm2.exec('node --experimental-vm-modules proxy.mjs', false)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k3000/s1",
3
- "version": "0.2.7",
3
+ "version": "0.3.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "sync": "npm link",