@joystick.js/cli-canary 0.0.0-canary.640 → 0.0.0-canary.642

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.
@@ -1,2 +1,2 @@
1
- import r from"child_process";import n from"util";const o=n.promisify(r.exec),p=async(e=0)=>{if(process.platform==="win32"){const s=(await o(`\\windows\\system32\\netstat.exe -a -n -o | findstr.exe :${e}`)).stdout?.split(`
2
- `);return(s&&s[0]&&s[0]?.split(" ")?.filter(t=>t!=="")?.map(t=>t?.replace("\r",""))?.pop())?.stdout||null}return(await o(`lsof -n -i:${e} | grep LISTEN | awk '{ print $2 }' | uniq`))?.stdout||null};var d=p;export{d as default};
1
+ import o from"child_process";import n from"util";const r=n.promisify(o.exec),p=async(e=0)=>{if(process.platform==="win32"){const s=(await r(`netstat -a -n -o | find "${e}"`)).stdout?.split(`
2
+ `);return s&&s[0]&&s[0]?.split(" ")?.filter(t=>t!=="")?.map(t=>t?.replace("\r",""))?.pop()||null}return(await r(`lsof -n -i:${e} | grep LISTEN | awk '{ print $2 }' | uniq`))?.stdout||null};var u=p;export{u as default};
@@ -1 +1 @@
1
- import{dirname as i}from"path";import{fileURLToPath as r}from"url";import a from"os";const _=r(import.meta.url),l=i(_),e=a.platform()==="win32",n={__package:l?.replace(e?"\\dist\\lib":"/dist/lib",e?"\\dist":"/dist"),__filename:(t="")=>r(t),__dirname:(t="")=>{const o=r(t);return i(o)}};var c=n;export{c as default};
1
+ import a from"os";import{dirname as i}from"path";import{fileURLToPath as r}from"url";const _=r(import.meta.url),l=i(_),e=a.platform()==="win32",n={__package:l?.replace(e?"\\dist\\lib":"/dist/lib",e?"\\dist":"/dist"),__filename:(t="")=>r(t),__dirname:(t="")=>{const o=r(t);return i(o)}};var c=n;export{c as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joystick.js/cli-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.640",
4
+ "version": "0.0.0-canary.642",
5
5
  "description": "The CLI for Joystick.",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
@@ -5,13 +5,13 @@ const exec = util.promisify(child_process.exec);
5
5
 
6
6
  const get_process_id_from_port = async (port = 0) => {
7
7
  if (process.platform === 'win32') {
8
- const stat = await exec(`\\windows\\system32\\netstat.exe -a -n -o | findstr.exe :${port}`);
8
+ const stat = await exec(`netstat -a -n -o | find "${port}"`);
9
9
  const stat_result = stat.stdout?.split('\n');
10
10
  const process_id_response = stat_result && stat_result[0] && stat_result[0]?.split(' ')?.filter((value) => value !== '')?.map((value) => {
11
11
  return value?.replace('\r', '');
12
12
  })?.pop();
13
13
 
14
- return process_id_response?.stdout || null;
14
+ return process_id_response || null;
15
15
  }
16
16
 
17
17
  const process_id_response = await exec(`lsof -n -i:${port} | grep LISTEN | awk '{ print $2 }' | uniq`);
@@ -1,6 +1,6 @@
1
+ import os from 'os';
1
2
  import { dirname } from "path";
2
3
  import { fileURLToPath as file_url_to_path } from "url";
3
- import os from 'os';
4
4
 
5
5
  const current_file_path = file_url_to_path(import.meta.url);
6
6
  const __package = dirname(current_file_path);