pid-port:获取使用特定端口的进程的ID

时间:2021-04-14 01:34:21
【文件属性】:
文件名称:pid-port:获取使用特定端口的进程的ID
文件大小:6KB
文件格式:ZIP
更新时间:2021-04-14 01:34:21
JavaScript pid端口 获取使用特定端口的进程的ID 安装 $ npm install pid-port 用法 const pidPort = require ( 'pid-port' ) ; ( async ( ) => { try { console . log ( await pidPort . portToPid ( 8080 ) ) ; //=> 1337 const pids = await pidPort . portToPid ( [ 8080 , 22 ] ) ; console . log ( pids . get ( 8080 ) ) ; //=> 1337 console . log ( pids . get ( 22 ) ) ; //=> 12345 } catch ( error ) { console . log ( error ) ;
【文件预览】:
pid-port-main
----.gitattributes(19B)
----.github()
--------funding.yml(21B)
--------workflows()
----test.js(2KB)
----license(1KB)
----.npmrc(19B)
----.editorconfig(175B)
----.gitignore(23B)
----index.js(3KB)
----readme.md(2KB)
----package.json(603B)

网友评论