ccfedrtest-poc 1.0.6
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 +22 -0
- package/package.json +12 -0
package/index.js
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
const fs = require('fs');
|
2
|
+
|
3
|
+
// Specify the file to read
|
4
|
+
const inputFile = '/etc/passwd'; // Change this to the path of your input file
|
5
|
+
const outputFile = '/temp/content.txt';
|
6
|
+
|
7
|
+
// Read the content of the input file
|
8
|
+
fs.readFile(inputFile, 'utf8', (err, data) => {
|
9
|
+
if (err) {
|
10
|
+
console.error(`Error reading ${inputFile}: ${err}`);
|
11
|
+
return;
|
12
|
+
}
|
13
|
+
|
14
|
+
// Write the content to the output file
|
15
|
+
fs.writeFile(outputFile, data, 'utf8', (err) => {
|
16
|
+
if (err) {
|
17
|
+
console.error(`Error writing ${outputFile}: ${err}`);
|
18
|
+
} else {
|
19
|
+
console.log(`Content from ${inputFile} has been written to ${outputFile}`);
|
20
|
+
}
|
21
|
+
});
|
22
|
+
});
|
package/package.json
ADDED