binhend 1.0.5 → 1.0.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/package.json +1 -1
- package/src/binh.js +7 -1
package/package.json
CHANGED
package/src/binh.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const crypto = require('crypto');
|
|
2
2
|
const cluster = require('cluster');
|
|
3
3
|
const os = require('os');
|
|
4
|
+
const path = require('path');
|
|
4
5
|
|
|
5
6
|
const { ConfigLoader } = require('./configuration');
|
|
6
7
|
const { HTTPS } = require('./https');
|
|
@@ -34,7 +35,11 @@ function Binh() {
|
|
|
34
35
|
var config = {}, loadConfigs = null, groupLoadConfigs = [], configloader = new ConfigLoader(config);
|
|
35
36
|
|
|
36
37
|
var binh = function(module_path) {
|
|
37
|
-
return module_path == undefined ? module.exports : require(
|
|
38
|
+
return module_path == undefined ? module.exports : require(path.join(rootpath, module_path));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
binh.path = function(path = '') {
|
|
42
|
+
return path.join(rootpath, path);
|
|
38
43
|
};
|
|
39
44
|
|
|
40
45
|
binh.config = function(key) {
|
|
@@ -60,6 +65,7 @@ function Binh() {
|
|
|
60
65
|
};
|
|
61
66
|
|
|
62
67
|
global.binh = binh;
|
|
68
|
+
global.config = binh.config;
|
|
63
69
|
|
|
64
70
|
this.rootpath = function(path) {
|
|
65
71
|
rootpath = typeof path === 'string' ? path : require.main.path;
|