gqeasynodemon 0.0.1
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/LICENSE +21 -0
- package/README.md +68 -0
- package/app.coffee +84 -0
- package/app.js +142 -0
- package/app2.coffee +17 -0
- package/app3.js +35 -0
- package/ecosystem.config.js +12 -0
- package/ecosystem_default.config.js +12 -0
- package/err.log +19 -0
- package/forever.json +14 -0
- package/forever_default.json +15 -0
- package/nodemon.json +19 -0
- package/nodemon_default.json +22 -0
- package/out.log +179 -0
- package/package.json +63 -0
- package/test.coffee +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) GraphQL Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# gqeasynodemon
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
.___
|
|
5
|
+
____ ______ ____ _____ _________.__. ____ ____ __| _/____ _____ ____ ____
|
|
6
|
+
/ ___\ / ____// __ \\__ \ / ___< | |/ \ / _ \ / __ |/ __ \ / \ / _ \ / \
|
|
7
|
+
/ /_/ >< <_| \ ___/ / __ \_\___ \ \___ | | ( <_> ) /_/ \ ___/| Y Y ( <_> ) | \
|
|
8
|
+
\___ / \__ |\___ >____ /____ >/ ____|___| /\____/\____ |\___ >__|_| /\____/|___| /
|
|
9
|
+
/_____/ |__| \/ \/ \/ \/ \/ \/ \/ \/ \/
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
* A utility tool for executing app.coffee using 3 methods: nodemon, forever and pm2.
|
|
15
|
+
|
|
16
|
+
## Getting Started
|
|
17
|
+
|
|
18
|
+
### Dependencies
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"gqnpminstallthenrequire": "0.0.3",
|
|
23
|
+
"coffee-script": "1.12.7",
|
|
24
|
+
"coffeescript": "2.7.0",
|
|
25
|
+
"nodemon": "3.1.10"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"gqtest": ">=0.0.21"
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Installing
|
|
33
|
+
|
|
34
|
+
* npm i --save gqeasynodemon
|
|
35
|
+
|
|
36
|
+
### Executing program
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
gq=require("gqeasynodemon")
|
|
40
|
+
|
|
41
|
+
cb=function(e,r){
|
|
42
|
+
console.log("server is ran!")
|
|
43
|
+
// your logic after server started
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
gq.forever(cb)
|
|
47
|
+
gq.nodemon(cb)
|
|
48
|
+
gq.pm2(cb)
|
|
49
|
+
|
|
50
|
+
----
|
|
51
|
+
* note:
|
|
52
|
+
** default executable is app.coffee
|
|
53
|
+
** Some of these routes does not print console.log as expected
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Authors
|
|
57
|
+
|
|
58
|
+
* glidev5
|
|
59
|
+
|
|
60
|
+
## Version History
|
|
61
|
+
|
|
62
|
+
* 0.1
|
|
63
|
+
* Initial Release
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
This project is licensed under the MIT License - see the LICENSE.md file for details
|
|
68
|
+
|
package/app.coffee
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
|
|
2
|
+
l=console.log
|
|
3
|
+
r=require
|
|
4
|
+
fs=r "fs"
|
|
5
|
+
x=r("child_process").exec
|
|
6
|
+
gq=r "gqnpminstallthenrequire"
|
|
7
|
+
@a={}
|
|
8
|
+
|
|
9
|
+
@a.nodemon=(cb,test=false)->
|
|
10
|
+
try
|
|
11
|
+
l "make nodemon.json"
|
|
12
|
+
if !fs.existsSync("./nodemon.json")
|
|
13
|
+
content=fs.readFileSync("nodemon_default.json").toString()
|
|
14
|
+
fs.writeFileSync("./nodemon.json",content)
|
|
15
|
+
l "npm install"
|
|
16
|
+
gq.npmInstall (e,r)->
|
|
17
|
+
l "install nodemon"
|
|
18
|
+
gq.npmGlobalInstallThenRequire {module:"nodemon",require:"fs"},(e,r)->
|
|
19
|
+
if e
|
|
20
|
+
l e
|
|
21
|
+
#l r
|
|
22
|
+
#x "nodemon --delay 1 -q --exitcrash -x \"coffee app2.coffee\"",(e,sto,ste)->
|
|
23
|
+
l "start:nodemon"
|
|
24
|
+
x (if test then "npm run-script test:start:nodemon" else "npm run-script start:nodemon"),(e,sto,ste)->
|
|
25
|
+
l sto
|
|
26
|
+
try
|
|
27
|
+
if e
|
|
28
|
+
l ste
|
|
29
|
+
cb e,sto
|
|
30
|
+
catch e
|
|
31
|
+
l e
|
|
32
|
+
catch e
|
|
33
|
+
l e
|
|
34
|
+
|
|
35
|
+
@a.forever=(cb,test=false)->
|
|
36
|
+
try
|
|
37
|
+
l "make forever.json"
|
|
38
|
+
if !fs.existsSync("./forever.json")
|
|
39
|
+
content=fs.readFileSync("forever_default.json").toString()
|
|
40
|
+
fs.writeFileSync("./forever.json",content)
|
|
41
|
+
l "npm install"
|
|
42
|
+
gq.npmInstall (e,r)->
|
|
43
|
+
l "install forever"
|
|
44
|
+
gq.npmGlobalInstallThenRequire {module:"forever",require:"fs"},(e,r)->
|
|
45
|
+
l "upgrade surge"
|
|
46
|
+
gq.npmGlobalInstallThenRequire {module:"surge:0.21.7",require:"fs"},(e,r)->
|
|
47
|
+
l "start:forever"
|
|
48
|
+
#x "forever start -a -o ./out.log -e ./err.log -m 2 --minUptime=1000 --spinSleepTime=1000 --trace-warnings -c \"node --require coffeescript/register --trace-warnings app2.coffee\" ./",(e,sto,ste)->
|
|
49
|
+
x (if test then "npm run-script test:start:forever" else "npm run-script start:forever"),(e,sto,ste)->
|
|
50
|
+
try
|
|
51
|
+
l sto
|
|
52
|
+
if e
|
|
53
|
+
l ste
|
|
54
|
+
cb e,sto
|
|
55
|
+
catch e
|
|
56
|
+
catch e
|
|
57
|
+
l e
|
|
58
|
+
|
|
59
|
+
@a.pm2=(cb,test=false)->
|
|
60
|
+
try
|
|
61
|
+
l "make ecosystem.config.js"
|
|
62
|
+
if !fs.existsSync("./ecosystem.config.js")
|
|
63
|
+
content=fs.readFileSync("ecosystem_default.config.js").toString()
|
|
64
|
+
fs.writeFileSync("./ecosystem.config.js",content)
|
|
65
|
+
l "npm install"
|
|
66
|
+
gq.npmInstall (e,r)->
|
|
67
|
+
l "install pm2"
|
|
68
|
+
gq.npmGlobalInstallThenRequire {module:"pm2",require:"fs"},(e,r)->
|
|
69
|
+
l "install pm2 coffeescript"
|
|
70
|
+
x "pm2 install coffeescript",(e,o,ste)->
|
|
71
|
+
l "start:pm2"
|
|
72
|
+
x (if test then "npm run-script test:start:pm2" else "npm run-script start:pm2"),(e,sto,ste)->
|
|
73
|
+
try
|
|
74
|
+
l sto
|
|
75
|
+
if e
|
|
76
|
+
l ste
|
|
77
|
+
cb e,sto
|
|
78
|
+
catch e
|
|
79
|
+
catch e
|
|
80
|
+
l e
|
|
81
|
+
|
|
82
|
+
@a.default=@a
|
|
83
|
+
|
|
84
|
+
module.exports=@a
|
package/app.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Generated by CoffeeScript 2.7.0
|
|
2
|
+
(function() {
|
|
3
|
+
var fs, gq, l, r, x;
|
|
4
|
+
|
|
5
|
+
l = console.log;
|
|
6
|
+
|
|
7
|
+
r = require;
|
|
8
|
+
|
|
9
|
+
fs = r("fs");
|
|
10
|
+
|
|
11
|
+
x = r("child_process").exec;
|
|
12
|
+
|
|
13
|
+
gq = r("gqnpminstallthenrequire");
|
|
14
|
+
|
|
15
|
+
this.a = {};
|
|
16
|
+
|
|
17
|
+
this.a.nodemon = function(cb, test = false) {
|
|
18
|
+
var content, e;
|
|
19
|
+
try {
|
|
20
|
+
l("make nodemon.json");
|
|
21
|
+
if (!fs.existsSync("./nodemon.json")) {
|
|
22
|
+
content = fs.readFileSync("nodemon_default.json").toString();
|
|
23
|
+
fs.writeFileSync("./nodemon.json", content);
|
|
24
|
+
}
|
|
25
|
+
l("npm install");
|
|
26
|
+
return gq.npmInstall(function(e, r) {
|
|
27
|
+
l("install nodemon");
|
|
28
|
+
return gq.npmGlobalInstallThenRequire({
|
|
29
|
+
module: "nodemon",
|
|
30
|
+
require: "fs"
|
|
31
|
+
}, function(e, r) {
|
|
32
|
+
if (e) {
|
|
33
|
+
l(e);
|
|
34
|
+
}
|
|
35
|
+
//l r
|
|
36
|
+
//x "nodemon --delay 1 -q --exitcrash -x \"coffee app2.coffee\"",(e,sto,ste)->
|
|
37
|
+
l("start:nodemon");
|
|
38
|
+
return x((test ? "npm run-script test:start:nodemon" : "npm run-script start:nodemon"), function(e, sto, ste) {
|
|
39
|
+
l(sto);
|
|
40
|
+
try {
|
|
41
|
+
if (e) {
|
|
42
|
+
l(ste);
|
|
43
|
+
}
|
|
44
|
+
return cb(e, sto);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
e = error;
|
|
47
|
+
return l(e);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
} catch (error) {
|
|
53
|
+
e = error;
|
|
54
|
+
return l(e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
this.a.forever = function(cb, test = false) {
|
|
59
|
+
var content, e;
|
|
60
|
+
try {
|
|
61
|
+
l("make forever.json");
|
|
62
|
+
if (!fs.existsSync("./forever.json")) {
|
|
63
|
+
content = fs.readFileSync("forever_default.json").toString();
|
|
64
|
+
fs.writeFileSync("./forever.json", content);
|
|
65
|
+
}
|
|
66
|
+
l("npm install");
|
|
67
|
+
return gq.npmInstall(function(e, r) {
|
|
68
|
+
l("install forever");
|
|
69
|
+
return gq.npmGlobalInstallThenRequire({
|
|
70
|
+
module: "forever",
|
|
71
|
+
require: "fs"
|
|
72
|
+
}, function(e, r) {
|
|
73
|
+
l("upgrade surge");
|
|
74
|
+
return gq.npmGlobalInstallThenRequire({
|
|
75
|
+
module: "surge:0.21.7",
|
|
76
|
+
require: "fs"
|
|
77
|
+
}, function(e, r) {
|
|
78
|
+
l("start:forever");
|
|
79
|
+
//x "forever start -a -o ./out.log -e ./err.log -m 2 --minUptime=1000 --spinSleepTime=1000 --trace-warnings -c \"node --require coffeescript/register --trace-warnings app2.coffee\" ./",(e,sto,ste)->
|
|
80
|
+
return x((test ? "npm run-script test:start:forever" : "npm run-script start:forever"), function(e, sto, ste) {
|
|
81
|
+
try {
|
|
82
|
+
l(sto);
|
|
83
|
+
if (e) {
|
|
84
|
+
l(ste);
|
|
85
|
+
}
|
|
86
|
+
return cb(e, sto);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
e = error;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
} catch (error) {
|
|
95
|
+
e = error;
|
|
96
|
+
return l(e);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
this.a.pm2 = function(cb, test = false) {
|
|
101
|
+
var content, e;
|
|
102
|
+
try {
|
|
103
|
+
l("make ecosystem.config.js");
|
|
104
|
+
if (!fs.existsSync("./ecosystem.config.js")) {
|
|
105
|
+
content = fs.readFileSync("ecosystem_default.config.js").toString();
|
|
106
|
+
fs.writeFileSync("./ecosystem.config.js", content);
|
|
107
|
+
}
|
|
108
|
+
l("npm install");
|
|
109
|
+
return gq.npmInstall(function(e, r) {
|
|
110
|
+
l("install pm2");
|
|
111
|
+
return gq.npmGlobalInstallThenRequire({
|
|
112
|
+
module: "pm2",
|
|
113
|
+
require: "fs"
|
|
114
|
+
}, function(e, r) {
|
|
115
|
+
l("install pm2 coffeescript");
|
|
116
|
+
return x("pm2 install coffeescript", function(e, o, ste) {
|
|
117
|
+
l("start:pm2");
|
|
118
|
+
return x((test ? "npm run-script test:start:pm2" : "npm run-script start:pm2"), function(e, sto, ste) {
|
|
119
|
+
try {
|
|
120
|
+
l(sto);
|
|
121
|
+
if (e) {
|
|
122
|
+
l(ste);
|
|
123
|
+
}
|
|
124
|
+
return cb(e, sto);
|
|
125
|
+
} catch (error) {
|
|
126
|
+
e = error;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
} catch (error) {
|
|
133
|
+
e = error;
|
|
134
|
+
return l(e);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
this.a.default = this.a;
|
|
139
|
+
|
|
140
|
+
module.exports = this.a;
|
|
141
|
+
|
|
142
|
+
}).call(this);
|
package/app2.coffee
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
r=require
|
|
2
|
+
l=console.log
|
|
3
|
+
fs=r "fs"
|
|
4
|
+
now=new Date()
|
|
5
|
+
@a={}
|
|
6
|
+
l "app2 is ran!"
|
|
7
|
+
setTimeout ()->
|
|
8
|
+
fs.appendFileSync './out.log',now.toISOString()+' app2 is ran!\n'
|
|
9
|
+
l "app2 is ran encore!"
|
|
10
|
+
,100
|
|
11
|
+
setTimeout ()->
|
|
12
|
+
process.kill(process.ppid)
|
|
13
|
+
process.exit(1)
|
|
14
|
+
,3000
|
|
15
|
+
@a.default=@a
|
|
16
|
+
@a.padLevels=10
|
|
17
|
+
module.exports=@a
|
package/app3.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Generated by CoffeeScript 2.7.0
|
|
2
|
+
(function() {
|
|
3
|
+
var fs, l, now, r, x;
|
|
4
|
+
|
|
5
|
+
r = require;
|
|
6
|
+
|
|
7
|
+
l = console.log;
|
|
8
|
+
|
|
9
|
+
fs = r("fs");
|
|
10
|
+
|
|
11
|
+
now = new Date();
|
|
12
|
+
|
|
13
|
+
x = r("child_process").exec;
|
|
14
|
+
|
|
15
|
+
this.a = {};
|
|
16
|
+
|
|
17
|
+
l("app3 is ran!");
|
|
18
|
+
|
|
19
|
+
setTimeout(function() {
|
|
20
|
+
fs.appendFileSync('./out.log', now.toISOString() + ' app3 is ran!\n');
|
|
21
|
+
return l("app3 is ran encore!");
|
|
22
|
+
}, 1000);
|
|
23
|
+
|
|
24
|
+
setTimeout(function() {
|
|
25
|
+
process.kill(process.ppid);
|
|
26
|
+
return process.exit(1);
|
|
27
|
+
}, 3000);
|
|
28
|
+
|
|
29
|
+
this.a.default = this.a;
|
|
30
|
+
|
|
31
|
+
this.a.padLevels = 10;
|
|
32
|
+
|
|
33
|
+
module.exports = this.a;
|
|
34
|
+
|
|
35
|
+
}).call(this);
|
package/err.log
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
node:internal/modules/package_json_reader:138
|
|
2
|
+
const result = modulesBinding.getNearestParentPackageJSON(checkPath);
|
|
3
|
+
^
|
|
4
|
+
|
|
5
|
+
Error: Invalid package config C:\Users\vlgx\dev\project\workbench\gqeasynodemon\package.json.
|
|
6
|
+
at Object.getNearestParentPackageJSON (node:internal/modules/package_json_reader:138:33)
|
|
7
|
+
at trySelf (node:internal/modules/cjs/loader:584:33)
|
|
8
|
+
at Module._resolveFilename (node:internal/modules/cjs/loader:1201:24)
|
|
9
|
+
at Module._load (node:internal/modules/cjs/loader:1050:27)
|
|
10
|
+
at internalRequire (node:internal/modules/cjs/loader:213:19)
|
|
11
|
+
at Module._preloadModules (node:internal/modules/cjs/loader:1711:5)
|
|
12
|
+
at loadPreloadModules (node:internal/process/pre_execution:744:5)
|
|
13
|
+
at setupUserModules (node:internal/process/pre_execution:207:5)
|
|
14
|
+
at prepareExecution (node:internal/process/pre_execution:160:5)
|
|
15
|
+
at prepareMainThreadExecution (node:internal/process/pre_execution:54:10) {
|
|
16
|
+
code: 'ERR_INVALID_PACKAGE_CONFIG'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Node.js v22.1.0
|
package/forever.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"script": "app3.coffee",
|
|
3
|
+
"sourceDir": "./",
|
|
4
|
+
"watch": true,
|
|
5
|
+
"ignoreWatch": ["node_modules", "logs", "*.log", "data.json"],
|
|
6
|
+
"spinSleepTime": 1000,
|
|
7
|
+
"append": true,
|
|
8
|
+
"logFile": "./log.log",
|
|
9
|
+
"outFile": "./out.log",
|
|
10
|
+
"errFile": "./err.log",
|
|
11
|
+
"env": {
|
|
12
|
+
"PAD_LEVELS": "false"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"script": "app.coffee",
|
|
3
|
+
"sourceDir": "./",
|
|
4
|
+
"watch": true,
|
|
5
|
+
"ignoreWatch": ["node_modules", "logs", "*.log", "data.json"],
|
|
6
|
+
"spinSleepTime": 1000,
|
|
7
|
+
"append": true,
|
|
8
|
+
"logFile": "./log.log",
|
|
9
|
+
"outFile": "./out.log",
|
|
10
|
+
"errFile": "./err.log",
|
|
11
|
+
"env": {
|
|
12
|
+
"NODE_ENV": "production",
|
|
13
|
+
"PAD_LEVELS": "false"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/nodemon.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"restartable": "rs",
|
|
3
|
+
"ignore": [
|
|
4
|
+
".git",
|
|
5
|
+
"node_modules/**/node_modules",
|
|
6
|
+
"data.json"
|
|
7
|
+
],
|
|
8
|
+
"verbose": false,
|
|
9
|
+
"watch": [ "./"
|
|
10
|
+
],
|
|
11
|
+
"env": {
|
|
12
|
+
"NODE_ENV": "development"
|
|
13
|
+
},
|
|
14
|
+
"ext": "js",
|
|
15
|
+
"events": {
|
|
16
|
+
"restart": "echo \"App restarted due to:\n'$FILENAME'\" with title \"nodemon\""
|
|
17
|
+
},
|
|
18
|
+
"signal": "SIGTERM"
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"restartable": "rs",
|
|
3
|
+
"ignore": [
|
|
4
|
+
".git",
|
|
5
|
+
"node_modules/**/node_modules",
|
|
6
|
+
"data.json"
|
|
7
|
+
],
|
|
8
|
+
"verbose": false,
|
|
9
|
+
"watch": [
|
|
10
|
+
"test/",
|
|
11
|
+
"*.coffee",
|
|
12
|
+
"*.js",
|
|
13
|
+
"*.json"
|
|
14
|
+
],
|
|
15
|
+
"env": {
|
|
16
|
+
"NODE_ENV": "development"
|
|
17
|
+
},
|
|
18
|
+
"ext": "js,coffee,json",
|
|
19
|
+
"events": {
|
|
20
|
+
"restart": "echo \"App restarted due to:\n'$FILENAME'\" with title \"nodemon\""
|
|
21
|
+
}
|
|
22
|
+
}
|
package/out.log
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
2026-08-29T21:31:57.275Z app2 is ran!
|
|
2
|
+
app2 is ran!
|
|
3
|
+
2026-08-29T21:51:16.347Z app2 is ran!
|
|
4
|
+
app2 is ran encore!
|
|
5
|
+
app2 is ran!
|
|
6
|
+
2026-08-29T21:52:42.416Z app2 is ran!
|
|
7
|
+
app2 is ran encore!
|
|
8
|
+
app2 is ran!
|
|
9
|
+
2026-08-29T21:55:08.987Z app2 is ran!
|
|
10
|
+
app2 is ran encore!
|
|
11
|
+
app2 is ran!
|
|
12
|
+
2026-08-29T21:55:51.371Z app2 is ran!
|
|
13
|
+
app2 is ran encore!
|
|
14
|
+
app2 is ran!
|
|
15
|
+
2026-08-29T21:55:54.602Z app2 is ran!
|
|
16
|
+
app2 is ran encore!
|
|
17
|
+
app2 is ran!
|
|
18
|
+
2026-08-29T22:00:40.678Z app2 is ran!
|
|
19
|
+
app2 is ran encore!
|
|
20
|
+
app2 is ran!
|
|
21
|
+
2026-08-29T22:00:43.892Z app2 is ran!
|
|
22
|
+
app2 is ran encore!
|
|
23
|
+
app2 is ran!
|
|
24
|
+
2026-08-29T22:02:25.972Z app2 is ran!
|
|
25
|
+
app2 is ran encore!
|
|
26
|
+
app2 is ran!
|
|
27
|
+
2026-08-29T22:02:29.197Z app2 is ran!
|
|
28
|
+
app2 is ran encore!
|
|
29
|
+
app2 is ran!
|
|
30
|
+
2026-08-29T22:02:39.353Z app2 is ran!
|
|
31
|
+
app2 is ran encore!
|
|
32
|
+
app2 is ran!
|
|
33
|
+
2026-08-29T22:02:42.572Z app2 is ran!
|
|
34
|
+
app2 is ran encore!
|
|
35
|
+
2026-08-29T22:05:18.519Z app2 is ran!
|
|
36
|
+
2026-08-29T22:14:37.878Z app2 is ran!
|
|
37
|
+
2026-08-29T22:22:36.103Z app2 is ran!
|
|
38
|
+
2026-08-29T22:22:39.327Z app2 is ran!
|
|
39
|
+
2026-08-29T22:22:42.556Z app2 is ran!
|
|
40
|
+
2026-08-29T22:22:45.774Z app2 is ran!
|
|
41
|
+
2026-08-29T22:22:48.996Z app2 is ran!
|
|
42
|
+
2026-08-29T22:22:52.219Z app2 is ran!
|
|
43
|
+
2026-08-29T22:22:55.449Z app2 is ran!
|
|
44
|
+
2026-08-29T22:22:58.673Z app2 is ran!
|
|
45
|
+
2026-08-29T22:23:01.912Z app2 is ran!
|
|
46
|
+
2026-08-29T22:23:05.130Z app2 is ran!
|
|
47
|
+
2026-08-29T22:23:08.354Z app2 is ran!
|
|
48
|
+
2026-08-29T22:23:11.586Z app2 is ran!
|
|
49
|
+
2026-08-29T22:23:14.811Z app2 is ran!
|
|
50
|
+
2026-08-29T22:23:40.996Z app2 is ran!
|
|
51
|
+
2026-08-29T22:24:27.928Z app2 is ran!
|
|
52
|
+
2026-08-29T22:24:31.144Z app2 is ran!
|
|
53
|
+
2026-08-29T22:24:34.338Z app2 is ran!
|
|
54
|
+
2026-08-29T22:24:37.548Z app2 is ran!
|
|
55
|
+
2026-08-29T22:24:40.745Z app2 is ran!
|
|
56
|
+
2026-08-29T22:24:43.954Z app2 is ran!
|
|
57
|
+
2026-08-29T22:24:47.169Z app2 is ran!
|
|
58
|
+
2026-08-29T22:24:50.376Z app2 is ran!
|
|
59
|
+
2026-08-29T22:24:53.603Z app2 is ran!
|
|
60
|
+
2026-08-29T22:24:56.814Z app2 is ran!
|
|
61
|
+
2026-08-29T22:25:00.027Z app2 is ran!
|
|
62
|
+
2026-08-29T22:25:03.246Z app2 is ran!
|
|
63
|
+
2026-08-29T22:25:06.445Z app2 is ran!
|
|
64
|
+
2026-08-29T22:25:09.647Z app2 is ran!
|
|
65
|
+
2026-08-29T22:25:12.868Z app2 is ran!
|
|
66
|
+
2026-08-29T22:25:16.071Z app2 is ran!
|
|
67
|
+
2026-08-29T22:25:19.283Z app2 is ran!
|
|
68
|
+
2026-08-29T22:25:22.475Z app2 is ran!
|
|
69
|
+
2026-08-29T22:25:25.665Z app2 is ran!
|
|
70
|
+
2026-08-29T22:25:28.874Z app2 is ran!
|
|
71
|
+
2026-08-29T22:25:32.078Z app2 is ran!
|
|
72
|
+
2026-08-29T22:25:35.282Z app2 is ran!
|
|
73
|
+
2026-08-29T22:25:38.490Z app2 is ran!
|
|
74
|
+
2026-08-29T22:25:41.696Z app2 is ran!
|
|
75
|
+
2026-08-29T22:25:44.900Z app2 is ran!
|
|
76
|
+
2026-08-29T22:25:48.109Z app2 is ran!
|
|
77
|
+
2026-08-29T22:25:51.318Z app2 is ran!
|
|
78
|
+
2026-08-29T22:25:54.522Z app2 is ran!
|
|
79
|
+
2026-08-29T22:25:57.721Z app2 is ran!
|
|
80
|
+
2026-08-29T22:26:00.937Z app2 is ran!
|
|
81
|
+
2026-08-29T22:26:04.143Z app2 is ran!
|
|
82
|
+
2026-08-29T22:26:07.339Z app2 is ran!
|
|
83
|
+
2026-08-29T22:26:10.548Z app2 is ran!
|
|
84
|
+
2026-08-29T22:26:13.743Z app2 is ran!
|
|
85
|
+
2026-08-29T22:26:16.957Z app2 is ran!
|
|
86
|
+
2026-08-29T22:26:20.176Z app2 is ran!
|
|
87
|
+
2026-08-29T22:26:23.380Z app2 is ran!
|
|
88
|
+
2026-08-29T22:26:26.584Z app2 is ran!
|
|
89
|
+
2026-08-29T22:26:29.794Z app2 is ran!
|
|
90
|
+
2026-08-29T22:26:33.003Z app2 is ran!
|
|
91
|
+
2026-08-29T22:26:36.207Z app2 is ran!
|
|
92
|
+
2026-08-29T22:26:36.210Z app2 is ran!
|
|
93
|
+
2026-08-29T22:26:39.419Z app2 is ran!
|
|
94
|
+
2026-08-29T22:26:42.621Z app2 is ran!
|
|
95
|
+
2026-08-29T22:26:45.841Z app2 is ran!
|
|
96
|
+
2026-08-29T22:26:49.049Z app2 is ran!
|
|
97
|
+
2026-08-29T22:26:52.256Z app2 is ran!
|
|
98
|
+
2026-08-29T22:26:55.465Z app2 is ran!
|
|
99
|
+
2026-08-29T22:26:58.671Z app2 is ran!
|
|
100
|
+
2026-08-29T22:27:01.883Z app2 is ran!
|
|
101
|
+
2026-08-29T22:27:05.084Z app2 is ran!
|
|
102
|
+
2026-08-29T22:27:08.281Z app2 is ran!
|
|
103
|
+
2026-08-29T22:27:11.475Z app2 is ran!
|
|
104
|
+
2026-08-29T22:27:14.691Z app2 is ran!
|
|
105
|
+
2026-08-29T22:27:17.896Z app2 is ran!
|
|
106
|
+
2026-08-29T22:27:21.105Z app2 is ran!
|
|
107
|
+
2026-08-29T22:27:24.314Z app2 is ran!
|
|
108
|
+
2026-08-29T22:27:27.504Z app2 is ran!
|
|
109
|
+
2026-08-29T22:27:30.716Z app2 is ran!
|
|
110
|
+
2026-08-29T22:27:33.953Z app2 is ran!
|
|
111
|
+
2026-08-29T22:27:37.221Z app2 is ran!
|
|
112
|
+
2026-08-29T22:27:40.438Z app2 is ran!
|
|
113
|
+
2026-08-29T22:27:43.654Z app2 is ran!
|
|
114
|
+
2026-08-29T22:27:46.879Z app2 is ran!
|
|
115
|
+
2026-08-29T22:27:50.089Z app2 is ran!
|
|
116
|
+
2026-08-29T22:27:53.304Z app2 is ran!
|
|
117
|
+
2026-08-29T22:27:55.066Z app2 is ran!
|
|
118
|
+
2026-08-29T22:27:56.529Z app2 is ran!
|
|
119
|
+
2026-08-29T22:27:59.732Z app2 is ran!
|
|
120
|
+
2026-08-29T22:28:02.943Z app2 is ran!
|
|
121
|
+
2026-08-29T22:28:06.142Z app2 is ran!
|
|
122
|
+
2026-08-29T22:28:09.357Z app2 is ran!
|
|
123
|
+
2026-08-29T22:28:12.559Z app2 is ran!
|
|
124
|
+
2026-08-29T22:28:15.767Z app2 is ran!
|
|
125
|
+
2026-08-29T22:28:18.978Z app2 is ran!
|
|
126
|
+
2026-08-29T22:28:22.179Z app2 is ran!
|
|
127
|
+
2026-08-29T22:28:25.378Z app2 is ran!
|
|
128
|
+
2026-08-29T22:28:28.581Z app2 is ran!
|
|
129
|
+
2026-08-29T22:28:31.784Z app2 is ran!
|
|
130
|
+
2026-08-29T22:28:34.996Z app2 is ran!
|
|
131
|
+
2026-08-29T22:28:38.187Z app2 is ran!
|
|
132
|
+
2026-08-29T22:28:41.404Z app2 is ran!
|
|
133
|
+
2026-08-29T22:28:44.620Z app2 is ran!
|
|
134
|
+
2026-08-29T22:28:47.840Z app2 is ran!
|
|
135
|
+
2026-08-29T22:28:51.056Z app2 is ran!
|
|
136
|
+
2026-08-29T22:28:54.277Z app2 is ran!
|
|
137
|
+
2026-08-29T22:28:57.495Z app2 is ran!
|
|
138
|
+
2026-08-29T22:29:00.719Z app2 is ran!
|
|
139
|
+
2026-08-29T22:29:03.940Z app2 is ran!
|
|
140
|
+
2026-08-29T22:29:07.163Z app2 is ran!
|
|
141
|
+
2026-08-29T22:29:10.379Z app2 is ran!
|
|
142
|
+
2026-08-29T22:29:13.600Z app2 is ran!
|
|
143
|
+
2026-08-29T22:29:16.819Z app2 is ran!
|
|
144
|
+
2026-08-29T22:29:20.050Z app2 is ran!
|
|
145
|
+
2026-08-29T22:29:23.272Z app2 is ran!
|
|
146
|
+
2026-08-29T22:29:26.478Z app2 is ran!
|
|
147
|
+
2026-08-29T22:29:29.712Z app2 is ran!
|
|
148
|
+
2026-08-29T22:29:32.940Z app2 is ran!
|
|
149
|
+
2026-08-29T22:29:36.154Z app2 is ran!
|
|
150
|
+
2026-08-29T22:29:39.380Z app2 is ran!
|
|
151
|
+
2026-08-29T22:29:42.591Z app2 is ran!
|
|
152
|
+
2026-08-29T22:29:45.892Z app2 is ran!
|
|
153
|
+
2026-08-29T22:29:49.090Z app2 is ran!
|
|
154
|
+
2026-08-29T23:28:01.007Z app3 is ran!
|
|
155
|
+
2026-08-29T23:30:03.141Z app3 is ran!
|
|
156
|
+
2026-08-29T23:31:26.056Z app3 is ran!
|
|
157
|
+
2026-08-29T23:32:21.934Z app3 is ran!
|
|
158
|
+
2026-08-29T23:33:18.004Z app3 is ran!
|
|
159
|
+
2026-08-29T23:33:43.611Z app3 is ran!
|
|
160
|
+
2026-08-29T23:34:30.203Z app3 is ran!
|
|
161
|
+
2026-08-29T23:35:38.004Z app3 is ran!
|
|
162
|
+
2026-08-29T23:36:50.806Z app3 is ran!
|
|
163
|
+
2026-08-29T23:37:46.964Z app3 is ran!
|
|
164
|
+
2026-08-29T23:38:28.438Z app4 is ran!
|
|
165
|
+
2026-08-29T23:38:56.802Z app3 is ran!
|
|
166
|
+
2026-08-29T23:39:16.540Z app4 is ran!
|
|
167
|
+
2026-08-29T23:44:30.435Z app2 is ran!
|
|
168
|
+
2026-08-29T23:46:08.396Z app3 is ran!
|
|
169
|
+
2026-08-29T23:46:48.899Z app2 is ran!
|
|
170
|
+
2026-08-29T23:47:02.804Z app3 is ran!
|
|
171
|
+
2026-08-29T23:53:41.494Z app2 is ran!
|
|
172
|
+
2026-08-29T23:59:33.934Z app2 is ran!
|
|
173
|
+
2026-08-29T23:59:57.646Z app3 is ran!
|
|
174
|
+
2026-08-30T00:13:50.837Z app2 is ran!
|
|
175
|
+
2026-08-30T00:14:13.683Z app3 is ran!
|
|
176
|
+
2026-08-30T00:16:24.369Z app2 is ran!
|
|
177
|
+
2026-08-30T00:16:48.588Z app3 is ran!
|
|
178
|
+
2026-08-30T00:34:06.212Z app2 is ran!
|
|
179
|
+
2026-08-30T00:34:32.611Z app3 is ran!
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gqeasynodemon",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A utility tool for executing app.coffee using 3 methods: nodemon, forever and pm2.",
|
|
5
|
+
"repository": "git@github.com:goldfiction/gqtesmplate5.git",
|
|
6
|
+
"contributors": [
|
|
7
|
+
"glidev5 <glidev5@gmail.com> (https://www.linkedin.com/in/grant-li-194a4521/)"
|
|
8
|
+
],
|
|
9
|
+
"private": false,
|
|
10
|
+
"main": "app.js",
|
|
11
|
+
"node_version": "18.20.2",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"gqnpminstallthenrequire": "0.0.3",
|
|
15
|
+
"coffee-script": "1.12.7",
|
|
16
|
+
"coffeescript": "2.7.0",
|
|
17
|
+
"nodemon": "3.1.10"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"gqtest": ">=0.0.21"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"start": "node --require coffeescript/register app2.coffee >> out.log",
|
|
24
|
+
"test": "node --require coffeescript/register test.coffee",
|
|
25
|
+
"test:start:forever": "forever start -a -m 1 app3.js",
|
|
26
|
+
"test:start:nodemon": "nodemon --delay 1 -q --exitcrash -x \"coffee app2.coffee\"",
|
|
27
|
+
"test:start:pm2": "pm2 start app3.js",
|
|
28
|
+
"start:forever": "forever start -a -o ./out.log -e ./err.log -l ./log.log --minUptime=1000 --spinSleepTime=1000 --trace-warnings -c \"node --require coffeescript/register --trace-warnings app.coffee\" ./",
|
|
29
|
+
"start:nodemon": "nodemon --delay 1 -q --exitcrash -x \"coffee app.coffee\"",
|
|
30
|
+
"start:pm2": "pm2 start app.coffee",
|
|
31
|
+
"test:real": "node --require coffeescript/register test.coffee",
|
|
32
|
+
"test:watch": "nodemon --delay 10 -q -x \"npm test\"",
|
|
33
|
+
"test:slow": "mocha --openssl-legacy-provider -require coffeescript/register --no-color --reporter min -t 20000 test/test.slow.coffee",
|
|
34
|
+
"install:nobin": "npm install --no-bin-links --no-optional --omit=optional --ignore-scripts",
|
|
35
|
+
"install:prod": "npm install --production",
|
|
36
|
+
"install:prod2": "npm install --omit=dev --no-bin-links",
|
|
37
|
+
"git": "git add .; git commit -m \"update\"; echo gitted...",
|
|
38
|
+
"git:push": "git push origin master & git push nodegit master & git push bitbucket master & echo pushed...",
|
|
39
|
+
"git:setup": "git config --global user.name \"username\";git config --global user.email \"username@gmail.com\";git branch --set-upstream-to=origin/master master;",
|
|
40
|
+
"test:dl": "npm run lint && npm run check && npm run testonly",
|
|
41
|
+
"test:ci": "npm run lint && npm run check && npm run testonly -- --coverage",
|
|
42
|
+
"lint": "eslint .",
|
|
43
|
+
"check": "flow check --max-warnings 0",
|
|
44
|
+
"build": "babel src --ignore src/__tests__ --out-dir dist/ ; cp src/index.js dist/index.js.flow ; cp src/index.d.ts dist/",
|
|
45
|
+
"watch": "babel resources/watch.js | node",
|
|
46
|
+
"testonly": "jest src",
|
|
47
|
+
"prerelease": ". ./resources/prepublish.sh",
|
|
48
|
+
"release": "changeset publish"
|
|
49
|
+
},
|
|
50
|
+
"prettier": {
|
|
51
|
+
"arrowParens": "avoid",
|
|
52
|
+
"singleQuote": true,
|
|
53
|
+
"trailingComma": "all",
|
|
54
|
+
"overrides": [
|
|
55
|
+
{
|
|
56
|
+
"files": "src/**/*.js",
|
|
57
|
+
"options": {
|
|
58
|
+
"parser": "babel-flow"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
package/test.coffee
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
q=require # use this to reference q
|
|
2
|
+
|
|
3
|
+
t=q 'gqtest' # use this line to reference gqtest
|
|
4
|
+
x=q("child_process").exec
|
|
5
|
+
|
|
6
|
+
f=t.it # this is done
|
|
7
|
+
xf=t.xit # this is a skipped case
|
|
8
|
+
g=t.doRun # this is doRun
|
|
9
|
+
|
|
10
|
+
n=null
|
|
11
|
+
l=console.log
|
|
12
|
+
a=q './app.coffee' # use this line to reference app
|
|
13
|
+
|
|
14
|
+
t.staging.beforeAll=(f)->
|
|
15
|
+
x "npm install --prefer-offline --no-audit --no-bin-links",(e,sto,ste)->
|
|
16
|
+
#l e
|
|
17
|
+
#a=q './app.coffee' # use this line to reference app
|
|
18
|
+
f e
|
|
19
|
+
# --prefer-offline --no-audit cause npm install to be fast when nothing new needs to be installed
|
|
20
|
+
# --require coffeescript/register makes script capable to run .coffee script without precompiling
|
|
21
|
+
# --no-bin-links makes script not install binary references, so it can be ran in docker environment
|
|
22
|
+
|
|
23
|
+
# dummy test for code integrity
|
|
24
|
+
f "should be able to run",(f)->
|
|
25
|
+
f n # f n is same as f(null)
|
|
26
|
+
|
|
27
|
+
xf "should be able to forever",(f)->
|
|
28
|
+
a.forever (e,r)->
|
|
29
|
+
f !e
|
|
30
|
+
,true
|
|
31
|
+
|
|
32
|
+
f "should be able to nodemon",(f)->
|
|
33
|
+
a.nodemon (e,r)->
|
|
34
|
+
f !e
|
|
35
|
+
,true
|
|
36
|
+
|
|
37
|
+
f "should be able to pm2",(f)->
|
|
38
|
+
a.pm2 (e,r)->
|
|
39
|
+
f !e
|
|
40
|
+
,true
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
g n,(e,r)-> # use this to doRun
|
|
45
|
+
#r.result.fail==0&&a.run()
|
|
46
|
+
n
|
|
47
|
+
# this one liner first install npm install
|
|
48
|
+
# then test g(null)
|
|
49
|
+
# then run a.run() when no error returned from any f tests
|
|
50
|
+
# this way, a.run() is ran automatically when npm install and all tests passed
|