mm_machine 2.0.1 → 2.0.3

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.
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "demo1",
3
+ "title": "测试模块2",
4
+ "description": "完整测试模块2",
5
+ "func_file": "./index.js",
6
+ "func_name": "",
7
+ "sort": 20,
8
+ "state": 1,
9
+ "show": 1
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "test1",
3
+ "title": "测试模块1",
4
+ "description": "完整测试模块1",
5
+ "func_file": "./index.js",
6
+ "func_name": "",
7
+ "sort": 10,
8
+ "state": 1,
9
+ "show": 1
10
+ }
@@ -0,0 +1,30 @@
1
+ var counter = 0;
2
+
3
+ function test() {
4
+ console.log("测试模块1执行", counter++);
5
+ }
6
+
7
+ function main() {
8
+ test();
9
+ return { message: "测试模块1返回", value: counter };
10
+ }
11
+
12
+ exports.main = main;
13
+
14
+ exports.main_before = function() {
15
+ console.log("测试模块1前置钩子");
16
+ };
17
+
18
+ exports.main_after = async function(ret) {
19
+ console.log("测试模块1后置钩子", ret);
20
+ };
21
+
22
+ exports.load = function() {
23
+ console.log("加载测试模块1");
24
+ };
25
+
26
+ exports.init = function() {
27
+ console.log("初始化测试模块1");
28
+ };
29
+
30
+ console.log("测试模块1被引用");
@@ -0,0 +1,6 @@
1
+ exports.main_after = function(ret) {
2
+ console.log("测试模块2后置处理", ret);
3
+ return ret;
4
+ };
5
+
6
+ console.log("测试模块2后置处理文件已加载");
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "demo2",
3
+ "title": "测试模块2",
4
+ "description": "完整测试模块1",
5
+ "func_file": "./main.js",
6
+ "func_name": "",
7
+ "sort": 10,
8
+ "state": 1,
9
+ "show": 1
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "test2",
3
+ "title": "测试模块2",
4
+ "description": "完整测试模块2",
5
+ "func_file": "./main.js",
6
+ "func_name": "",
7
+ "sort": 20,
8
+ "state": 1,
9
+ "show": 1
10
+ }
@@ -0,0 +1,18 @@
1
+ var count = 0;
2
+
3
+ function main() {
4
+ console.log("测试模块2执行", count++);
5
+ return { result: "测试模块2结果", count: count };
6
+ }
7
+
8
+ exports.main = main;
9
+
10
+ exports.load = function() {
11
+ console.log("加载测试模块2");
12
+ };
13
+
14
+ exports.init = function() {
15
+ console.log("初始化测试模块2");
16
+ };
17
+
18
+ console.log("测试模块2被引用");
@@ -0,0 +1,34 @@
1
+ {
2
+ /**
3
+ * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
+ */
5
+ "name": "demo1",
6
+ /**
7
+ * 标题, 介绍作用
8
+ */
9
+ "title": "示例脚本1",
10
+ /**
11
+ * 描述, 用于描述该有什么用的
12
+ */
13
+ "description": "用于测试动态加载、更新、卸载、删除脚本",
14
+ /**
15
+ * 文件路径, 当调用函数不存在时,会先从文件中加载
16
+ */
17
+ "func_file": "./index.js",
18
+ /**
19
+ * 回调函数名 用于决定调用脚本的哪个函数
20
+ */
21
+ "func_name": "",
22
+ /**
23
+ * 排序
24
+ */
25
+ "sort": 10,
26
+ /**
27
+ * 状态, 0表示未启用, 1表示启用
28
+ */
29
+ "state": 0,
30
+ /**
31
+ * 显示, 0表示不显示, 1表示显示
32
+ */
33
+ "show": 0
34
+ }
@@ -1,34 +1,34 @@
1
- {
2
- /**
3
- * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
- */
5
- "name": "demo1",
6
- /**
7
- * 标题, 介绍作用
8
- */
9
- "title": "示例脚本1",
10
- /**
11
- * 描述, 用于描述该有什么用的
12
- */
13
- "description": "用于测试动态加载、更新、卸载、删除脚本",
14
- /**
15
- * 文件路径, 当调用函数不存在时,会先从文件中加载
16
- */
17
- "func_file": "./index.js",
18
- /**
19
- * 回调函数名 用于决定调用脚本的哪个函数
20
- */
21
- "func_name": "",
22
- /**
23
- * 排序
24
- */
25
- "sort": 10,
26
- /**
27
- * 状态, 0表示未启用, 1表示启用
28
- */
29
- "state": 0,
30
- /**
31
- * 显示, 0表示不显示, 1表示显示
32
- */
33
- "show": 0
1
+ {
2
+ /**
3
+ * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
+ */
5
+ "name": "demo1",
6
+ /**
7
+ * 标题, 介绍作用
8
+ */
9
+ "title": "示例脚本1",
10
+ /**
11
+ * 描述, 用于描述该有什么用的
12
+ */
13
+ "description": "用于测试动态加载、更新、卸载、删除脚本",
14
+ /**
15
+ * 文件路径, 当调用函数不存在时,会先从文件中加载
16
+ */
17
+ "func_file": "./index.js",
18
+ /**
19
+ * 回调函数名 用于决定调用脚本的哪个函数
20
+ */
21
+ "func_name": "",
22
+ /**
23
+ * 排序
24
+ */
25
+ "sort": 10,
26
+ /**
27
+ * 状态, 0表示未启用, 1表示启用
28
+ */
29
+ "state": 0,
30
+ /**
31
+ * 显示, 0表示不显示, 1表示显示
32
+ */
33
+ "show": 0
34
34
  }
@@ -1,30 +1,30 @@
1
- var i = 0;
2
-
3
- function test() {
4
- console.log("你好123", i++)
5
- }
6
-
7
- function main() {
8
- test();
9
- return i;
10
- }
11
-
12
- exports.main = main;
13
-
14
- exports.main_before = function() {
15
- console.log("test1请求前")
16
- }
17
-
18
- exports.main_after = async function(ret) {
19
- console.log("test1请求后", ret)
20
- }
21
-
22
- exports.load = function() {
23
- console.log("加载test1");
24
- }
25
-
26
- exports.init = function() {
27
- console.log("初始化test1");
28
- }
29
-
1
+ var i = 0;
2
+
3
+ function test() {
4
+ console.log("你好7654321", i++)
5
+ }
6
+
7
+ function main() {
8
+ test();
9
+ return i;
10
+ }
11
+
12
+ exports.main = main;
13
+
14
+ exports.main_before = function() {
15
+ console.log("test1请求前")
16
+ }
17
+
18
+ exports.main_after = async function(ret) {
19
+ console.log("test1请求后", ret)
20
+ }
21
+
22
+ exports.load = function() {
23
+ console.log("加载test1");
24
+ }
25
+
26
+ exports.init = function() {
27
+ console.log("初始化test1");
28
+ }
29
+
30
30
  console.log("引用了test1")
@@ -1,15 +1,15 @@
1
- class Demo {
2
- constructor() {}
3
- }
4
- var i = 0;
5
- Demo.prototype.main = function() {
6
- console.log("我很好123", i++);
7
- return i;
8
- }
9
- Demo.prototype.init = function(){
10
- console.log("初始化test2");
11
- }
12
-
13
- module.exports = new Demo();
14
-
1
+ class Demo {
2
+ constructor() {}
3
+ }
4
+ var i = 0;
5
+ Demo.prototype.main = function() {
6
+ console.log("我很好123", i++);
7
+ return i;
8
+ }
9
+ Demo.prototype.init = function(){
10
+ console.log("初始化test2");
11
+ }
12
+
13
+ module.exports = new Demo();
14
+
15
15
  console.log("引用了test2 after")
@@ -0,0 +1,68 @@
1
+ [{
2
+ /**
3
+ * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
+ */
5
+ "name": "demo2",
6
+ /**
7
+ * 标题, 介绍作用
8
+ */
9
+ "title": "示例脚本2",
10
+ /**
11
+ * 描述, 用于描述该有什么用的
12
+ */
13
+ "description": "用于测试动态加载、更新、卸载、删除脚本",
14
+ /**
15
+ * 文件路径, 当调用函数不存在时,会先从文件中加载
16
+ */
17
+ "func_file": "./main.js",
18
+ /**
19
+ * 回调函数名 用于决定调用脚本的哪个函数
20
+ */
21
+ "func_name": "",
22
+ /**
23
+ * 排序
24
+ */
25
+ "sort": 10,
26
+ /**
27
+ * 状态, 0表示未启用, 1表示启用
28
+ */
29
+ "state": 1,
30
+ /**
31
+ * 显示, 0表示不显示, 1表示显示
32
+ */
33
+ "show": 0
34
+ },
35
+ {
36
+ /**
37
+ * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
38
+ */
39
+ "name": "demo3",
40
+ /**
41
+ * 标题, 介绍作用
42
+ */
43
+ "title": "示例脚本3",
44
+ /**
45
+ * 描述, 用于描述该有什么用的
46
+ */
47
+ "description": "用于测试动态加载、更新、卸载、删除脚本",
48
+ /**
49
+ * 文件路径, 当调用函数不存在时,会先从文件中加载
50
+ */
51
+ "func_file": "./after.js",
52
+ /**
53
+ * 回调函数名 用于决定调用脚本的哪个函数
54
+ */
55
+ "func_name": "main",
56
+ /**
57
+ * 排序
58
+ */
59
+ "sort": 10,
60
+ /**
61
+ * 状态, 0表示未启用, 1表示启用
62
+ */
63
+ "state": 1,
64
+ /**
65
+ * 显示, 0表示不显示, 1表示显示
66
+ */
67
+ "show": 0
68
+ }]
@@ -1,68 +1,68 @@
1
- [{
2
- /**
3
- * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
- */
5
- "name": "demo2",
6
- /**
7
- * 标题, 介绍作用
8
- */
9
- "title": "示例脚本2",
10
- /**
11
- * 描述, 用于描述该有什么用的
12
- */
13
- "description": "用于测试动态加载、更新、卸载、删除脚本",
14
- /**
15
- * 文件路径, 当调用函数不存在时,会先从文件中加载
16
- */
17
- "func_file": "./main.js",
18
- /**
19
- * 回调函数名 用于决定调用脚本的哪个函数
20
- */
21
- "func_name": "",
22
- /**
23
- * 排序
24
- */
25
- "sort": 10,
26
- /**
27
- * 状态, 0表示未启用, 1表示启用
28
- */
29
- "state": 1,
30
- /**
31
- * 显示, 0表示不显示, 1表示显示
32
- */
33
- "show": 0
34
- },
35
- {
36
- /**
37
- * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
38
- */
39
- "name": "demo3",
40
- /**
41
- * 标题, 介绍作用
42
- */
43
- "title": "示例脚本3",
44
- /**
45
- * 描述, 用于描述该有什么用的
46
- */
47
- "description": "用于测试动态加载、更新、卸载、删除脚本",
48
- /**
49
- * 文件路径, 当调用函数不存在时,会先从文件中加载
50
- */
51
- "func_file": "./after.js",
52
- /**
53
- * 回调函数名 用于决定调用脚本的哪个函数
54
- */
55
- "func_name": "main",
56
- /**
57
- * 排序
58
- */
59
- "sort": 10,
60
- /**
61
- * 状态, 0表示未启用, 1表示启用
62
- */
63
- "state": 1,
64
- /**
65
- * 显示, 0表示不显示, 1表示显示
66
- */
67
- "show": 0
1
+ [{
2
+ /**
3
+ * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
+ */
5
+ "name": "demo2",
6
+ /**
7
+ * 标题, 介绍作用
8
+ */
9
+ "title": "示例脚本2",
10
+ /**
11
+ * 描述, 用于描述该有什么用的
12
+ */
13
+ "description": "用于测试动态加载、更新、卸载、删除脚本",
14
+ /**
15
+ * 文件路径, 当调用函数不存在时,会先从文件中加载
16
+ */
17
+ "func_file": "./main.js",
18
+ /**
19
+ * 回调函数名 用于决定调用脚本的哪个函数
20
+ */
21
+ "func_name": "",
22
+ /**
23
+ * 排序
24
+ */
25
+ "sort": 10,
26
+ /**
27
+ * 状态, 0表示未启用, 1表示启用
28
+ */
29
+ "state": 1,
30
+ /**
31
+ * 显示, 0表示不显示, 1表示显示
32
+ */
33
+ "show": 0
34
+ },
35
+ {
36
+ /**
37
+ * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
38
+ */
39
+ "name": "demo3",
40
+ /**
41
+ * 标题, 介绍作用
42
+ */
43
+ "title": "示例脚本3",
44
+ /**
45
+ * 描述, 用于描述该有什么用的
46
+ */
47
+ "description": "用于测试动态加载、更新、卸载、删除脚本",
48
+ /**
49
+ * 文件路径, 当调用函数不存在时,会先从文件中加载
50
+ */
51
+ "func_file": "./after.js",
52
+ /**
53
+ * 回调函数名 用于决定调用脚本的哪个函数
54
+ */
55
+ "func_name": "main",
56
+ /**
57
+ * 排序
58
+ */
59
+ "sort": 10,
60
+ /**
61
+ * 状态, 0表示未启用, 1表示启用
62
+ */
63
+ "state": 1,
64
+ /**
65
+ * 显示, 0表示不显示, 1表示显示
66
+ */
67
+ "show": 0
68
68
  }]
@@ -1,15 +1,15 @@
1
- class Demo {
2
- constructor() {}
3
- }
4
- var i = 0;
5
- Demo.prototype.main = function() {
6
- console.log("我很好7654321", i++);
7
- return i;
8
- }
9
- Demo.prototype.init = function(){
10
- console.log("初始化test2");
11
- }
12
-
13
- module.exports = new Demo();
14
-
1
+ class Demo {
2
+ constructor() {}
3
+ }
4
+ var i = 0;
5
+ Demo.prototype.main = function() {
6
+ console.log("我很好7654321", i++);
7
+ return i;
8
+ }
9
+ Demo.prototype.init = function(){
10
+ console.log("初始化test2");
11
+ }
12
+
13
+ module.exports = new Demo();
14
+
15
15
  console.log("引用了test2")
@@ -1,16 +1,16 @@
1
- class Demo {
2
- constructor() {}
3
- }
4
- var i = 0;
5
- Demo.prototype.main = function() {
6
- console.log("test2 main", i++);
7
- return i;
8
- }
9
-
10
- Demo.prototype.init = function() {
11
- console.log("test2 init");
12
- }
13
-
14
- module.exports = new Demo();
15
-
1
+ class Demo {
2
+ constructor() {}
3
+ }
4
+ var i = 0;
5
+ Demo.prototype.main = function() {
6
+ console.log("test2 main", i++);
7
+ return i;
8
+ }
9
+
10
+ Demo.prototype.init = function() {
11
+ console.log("test2 init");
12
+ }
13
+
14
+ module.exports = new Demo();
15
+
16
16
  console.log("引用了test2 main")
@@ -1,34 +1,34 @@
1
- {
2
- /**
3
- * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
- */
5
- "name": "demo1",
6
- /**
7
- * 标题, 介绍作用
8
- */
9
- "title": "示例脚本1",
10
- /**
11
- * 描述, 用于描述该有什么用的
12
- */
13
- "description": "用于测试动态加载、更新、卸载、删除脚本",
14
- /**
15
- * 文件路径, 当调用函数不存在时,会先从文件中加载
16
- */
17
- "func_file": "./index.js",
18
- /**
19
- * 回调函数名 用于决定调用脚本的哪个函数
20
- */
21
- "func_name": "",
22
- /**
23
- * 排序
24
- */
25
- "sort": 10,
26
- /**
27
- * 状态, 0表示未启用, 1表示启用
28
- */
29
- "state": 0,
30
- /**
31
- * 显示, 0表示不显示, 1表示显示
32
- */
33
- "show": 0
1
+ {
2
+ /**
3
+ * 名称, 由中英文和下“_”组成, 用于卸载接口 例如: demo
4
+ */
5
+ "name": "demo1",
6
+ /**
7
+ * 标题, 介绍作用
8
+ */
9
+ "title": "示例脚本1",
10
+ /**
11
+ * 描述, 用于描述该有什么用的
12
+ */
13
+ "description": "用于测试动态加载、更新、卸载、删除脚本",
14
+ /**
15
+ * 文件路径, 当调用函数不存在时,会先从文件中加载
16
+ */
17
+ "func_file": "./index.js",
18
+ /**
19
+ * 回调函数名 用于决定调用脚本的哪个函数
20
+ */
21
+ "func_name": "",
22
+ /**
23
+ * 排序
24
+ */
25
+ "sort": 10,
26
+ /**
27
+ * 状态, 0表示未启用, 1表示启用
28
+ */
29
+ "state": 0,
30
+ /**
31
+ * 显示, 0表示不显示, 1表示显示
32
+ */
33
+ "show": 0
34
34
  }