puppyperpetual 1.2.6 → 1.2.7
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/README.md +56 -58
- package/package.json +1 -1
- package/src/ProcessManager.js +1 -1
package/README.md
CHANGED
|
@@ -1,59 +1,57 @@
|
|
|
1
|
-
# puppyperpetual
|
|
2
|
-
|
|
3
|
-
node script to run things... perpetually. adapted from [legacyshell](https://github.com/onlypuppy7/LegacyShell)
|
|
4
|
-
|
|
5
|
-
[On npm @ https://www.npmjs.com/package/puppyperpetual](https://www.npmjs.com/package/puppyperpetual)
|
|
6
|
-
|
|
7
|
-
[And GitHub @ https://github.com/onlypuppy7/perpetual](https://github.com/onlypuppy7/perpetual)
|
|
8
|
-
|
|
9
|
-
## usage (as an npm package)
|
|
10
|
-
|
|
11
|
-
you can use it to run your node stuff perpetually:
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import Perpetual from '../index.js';
|
|
15
|
-
|
|
16
|
-
const perpetual = new Perpetual('test_process', {
|
|
17
|
-
process_cmd: 'node ./src/test/test_process.js',
|
|
18
|
-
});
|
|
19
|
-
await perpetual.run();
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
or anything really:
|
|
23
|
-
|
|
24
|
-
```js
|
|
25
|
-
import Perpetual from '../index.js';
|
|
26
|
-
|
|
27
|
-
const perpetual = new Perpetual('test_process', {
|
|
28
|
-
process_cmd: 'cd . && git pull && date',
|
|
29
|
-
});
|
|
30
|
-
await perpetual.run();
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## usage (as a node app thing)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
then
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
## it doesnt work?
|
|
58
|
-
|
|
1
|
+
# puppyperpetual
|
|
2
|
+
|
|
3
|
+
node script to run things... perpetually. adapted from [legacyshell](https://github.com/onlypuppy7/LegacyShell)
|
|
4
|
+
|
|
5
|
+
[On npm @ https://www.npmjs.com/package/puppyperpetual](https://www.npmjs.com/package/puppyperpetual)
|
|
6
|
+
|
|
7
|
+
[And GitHub @ https://github.com/onlypuppy7/perpetual](https://github.com/onlypuppy7/perpetual)
|
|
8
|
+
|
|
9
|
+
## usage (as an npm package)
|
|
10
|
+
|
|
11
|
+
you can use it to run your node stuff perpetually:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import Perpetual from '../index.js';
|
|
15
|
+
|
|
16
|
+
const perpetual = new Perpetual('test_process', {
|
|
17
|
+
process_cmd: 'node ./src/test/test_process.js',
|
|
18
|
+
});
|
|
19
|
+
await perpetual.run();
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
or anything really:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import Perpetual from '../index.js';
|
|
26
|
+
|
|
27
|
+
const perpetual = new Perpetual('test_process', {
|
|
28
|
+
process_cmd: 'cd . && git pull && date',
|
|
29
|
+
});
|
|
30
|
+
await perpetual.run();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## usage (as a node app thing)
|
|
34
|
+
|
|
35
|
+
as per tradition for my projects, simple installation!
|
|
36
|
+
|
|
37
|
+
1. `npm i`
|
|
38
|
+
|
|
39
|
+
then run once to create config
|
|
40
|
+
|
|
41
|
+
- `npm run start`
|
|
42
|
+
|
|
43
|
+
then customise it in `store/config.yaml`, making a new entry for every thing
|
|
44
|
+
|
|
45
|
+
then run like this:
|
|
46
|
+
|
|
47
|
+
- `node .\perpetual.js --default`
|
|
48
|
+
|
|
49
|
+
alternatively, just pass in your command:
|
|
50
|
+
|
|
51
|
+
- `node .\perpetual.js "cd . && echo date"`
|
|
52
|
+
|
|
53
|
+
then you dont need to mess around with the horrible yaml. dont worry, i hate doing it too.
|
|
54
|
+
|
|
55
|
+
## it doesnt work?
|
|
56
|
+
|
|
59
57
|
i dont care. i use this for my own stuff. i know that it works on linux and thats all i need.
|
package/package.json
CHANGED
package/src/ProcessManager.js
CHANGED
|
@@ -54,7 +54,7 @@ export class ProcessManager {
|
|
|
54
54
|
this.logger.logSend(`Starting process: ${this.options.process_cmd}`);
|
|
55
55
|
|
|
56
56
|
const useWorkerThreads = this.options.useWorkerThreads ?? false;
|
|
57
|
-
const isNodeScript = this.options.process_cmd.startsWith('node ') || this.options.
|
|
57
|
+
const isNodeScript = this.options.process_cmd.startsWith('node ') || this.options.isNodeScript;
|
|
58
58
|
let scriptPath = this.options.process_cmd;
|
|
59
59
|
|
|
60
60
|
if (isNodeScript && useWorkerThreads) {
|