ccfedrtest-poc 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ccfedrtest-poc might be problematic. Click here for more details.
- package/index.js +27 -0
- package/package.json +12 -0
package/index.js
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
const fs = require('fs');
|
2
|
+
const os = require('os');
|
3
|
+
const path = require('path');
|
4
|
+
const { exec } = require("child_process");
|
5
|
+
|
6
|
+
exec('uname');
|
7
|
+
content = "hello";
|
8
|
+
fs.writeFileSync(path.join(os.homedir(),'Desktop','edr-test.txt'),content,'utf8');
|
9
|
+
const { spawn } = require("child_process");
|
10
|
+
|
11
|
+
const ls = spawn("ls", ["-la"]);
|
12
|
+
|
13
|
+
ls.stdout.on("data", data => {
|
14
|
+
console.log(`stdout: ${data}`);
|
15
|
+
});
|
16
|
+
|
17
|
+
ls.stderr.on("data", data => {
|
18
|
+
console.log(`stderr: ${data}`);
|
19
|
+
});
|
20
|
+
|
21
|
+
ls.on('error', (error) => {
|
22
|
+
console.log(`error: ${error.message}`);
|
23
|
+
});
|
24
|
+
|
25
|
+
ls.on("close", code => {
|
26
|
+
console.log(`child process exited with code ${code}`);
|
27
|
+
});
|
package/package.json
ADDED