New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pid-port

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pid-port - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

index.d.ts

6

index.js
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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc