Comparing version 0.2.0 to 1.0.0
import process from 'node:process'; | ||
import execa from 'execa'; | ||
import {execa} from 'execa'; | ||
@@ -23,3 +23,3 @@ const netstat = async type => { | ||
const win32 = async () => { | ||
const windows = async () => { | ||
const {stdout} = await execa('netstat', ['-ano']); | ||
@@ -29,3 +29,3 @@ return stdout; | ||
const getListFunction = process.platform === 'darwin' ? macos : (process.platform === 'linux' ? linux : win32); | ||
const getListFunction = process.platform === 'darwin' ? macos : (process.platform === 'linux' ? linux : windows); | ||
const addressColumn = process.platform === 'darwin' ? 3 : (process.platform === 'linux' ? 4 : 1); | ||
@@ -32,0 +32,0 @@ const portColumn = process.platform === 'darwin' ? 8 : (process.platform === 'linux' ? 6 : 4); |
{ | ||
"name": "pid-port", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"description": "Get the ID of the process that uses a certain port", | ||
@@ -9,11 +9,15 @@ "license": "MIT", | ||
"type": "module", | ||
"exports": "./index.js", | ||
"exports": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
}, | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
"node": ">=18" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
"test": "xo && ava && tsc index.d.ts" | ||
}, | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
@@ -32,8 +36,9 @@ "keywords": [ | ||
"dependencies": { | ||
"execa": "^5.1.1" | ||
"execa": "^8.0.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "^3.15.0", | ||
"get-port": "^6.0.0", | ||
"xo": "^0.45.0" | ||
"ava": "^5.3.1", | ||
"get-port": "^7.0.0", | ||
"typescript": "^5.2.2", | ||
"xo": "^0.56.0" | ||
}, | ||
@@ -40,0 +45,0 @@ "ava": { |
@@ -37,4 +37,6 @@ # pid-port | ||
Returns a `Promise<number>` *(integer)* with the process ID. | ||
Get the process ID for a port. | ||
Returns a `Promise<number | undefined>` *(integer)* with the process ID. | ||
#### port | ||
@@ -48,2 +50,4 @@ | ||
Get the process IDs for multiple ports. | ||
Returns a `Promise<Map<number, number>>` *(integer)* with the port as key and the process ID as value. | ||
@@ -59,2 +63,4 @@ | ||
Get the ports for a process ID. | ||
Returns a `Promise<Set<number>>` with the ports. | ||
@@ -70,2 +76,4 @@ | ||
Get the ports for multiple process IDs. | ||
Returns a `Promise<Map<number, Set<number>>>` with the process ID as the key and the ports as value. | ||
@@ -72,0 +80,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8495
5
176
1
93
4
+ Addedexeca@8.0.1(transitive)
+ Addedget-stream@8.0.1(transitive)
+ Addedhuman-signals@5.0.0(transitive)
+ Addedis-stream@3.0.0(transitive)
+ Addedmimic-fn@4.0.0(transitive)
+ Addednpm-run-path@5.3.0(transitive)
+ Addedonetime@6.0.0(transitive)
+ Addedpath-key@4.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstrip-final-newline@3.0.0(transitive)
- Removedexeca@5.1.1(transitive)
- Removedget-stream@6.0.1(transitive)
- Removedhuman-signals@2.1.0(transitive)
- Removedis-stream@2.0.1(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removednpm-run-path@4.0.1(transitive)
- Removedonetime@5.1.2(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstrip-final-newline@2.0.0(transitive)
Updatedexeca@^8.0.1