get-port:获取可用的TCP端口

时间:2021-05-06 04:19:16
【文件属性】:
文件名称:get-port:获取可用的TCP端口
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-06 04:19:16
JavaScript 获取端口 获取可用的 安装 $ npm install get-port 用法 const getPort = require ( 'get-port' ) ; ( async ( ) => { console . log ( await getPort ( ) ) ; //=> 51402 } ) ( ) ; 传递首选端口: ( async ( ) => { console . log ( await getPort ( { port : 3000 } ) ) ; // Will use 3000 if available, otherwise fall back to a random port } ) ( ) ; 传递一组首选端口: ( async ( ) => { console . log ( await getPort ( { port : [ 3000 ,
【文件预览】:
get-port-main
----.gitignore(23B)
----.github()
--------security.md(179B)
--------workflows()
--------funding.yml(114B)
----.gitattributes(19B)
----package.json(746B)
----index.test-d.ts(406B)
----readme.md(2KB)
----index.js(3KB)
----index.d.ts(2KB)
----test.js(4KB)
----.editorconfig(175B)
----license(1KB)
----.npmrc(19B)

网友评论