Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-port-please

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-port-please - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

16

dist/index.d.ts

@@ -11,6 +11,14 @@ interface GetPortOptions {

declare type GetPortInput = Partial<GetPortOptions> | number | string;
declare function getPort(config?: GetPortInput): Promise<number>;
declare function checkPorts(ports: number[], host?: string): Promise<number>;
declare function checkPort(port: number, host?: string): Promise<number | false>;
declare type HostAddress = undefined | string;
declare type PortNumber = number;
declare function getPort(config?: GetPortInput): Promise<PortNumber>;
declare function getRandomPort(host: HostAddress): Promise<number>;
declare function checkPort(port: PortNumber, host?: HostAddress | HostAddress[]): Promise<PortNumber | false>;
interface WaitForPortOptions {
host?: HostAddress;
delay?: number;
retries?: number;
}
declare function waitForPort(port: PortNumber, opts?: WaitForPortOptions): Promise<void>;
export { GetPortInput, GetPortOptions, checkPort, checkPorts, getPort };
export { GetPortInput, GetPortOptions, HostAddress, PortNumber, WaitForPortOptions, checkPort, getPort, getRandomPort, waitForPort };
{
"name": "get-port-please",
"version": "2.3.0",
"version": "2.4.0",
"description": "Get an available TCP port to listen",

@@ -23,3 +23,3 @@ "repository": "unjs/get-port-please",

"release": "yarn build && standard-version && npm publish && git push --follow-tags",
"test": "jest"
"test": "vitest"
},

@@ -31,12 +31,10 @@ "dependencies": {

"@nuxtjs/eslint-config-typescript": "latest",
"@types/jest": "latest",
"@types/node": "latest",
"c8": "latest",
"eslint": "latest",
"jest": "latest",
"standard-version": "latest",
"ts-jest": "latest",
"ts-node": "latest",
"typescript": "latest",
"unbuild": "latest"
"unbuild": "latest",
"vitest": "^0.5.5"
}
}

@@ -21,10 +21,13 @@ ![get-port-please](https://user-images.githubusercontent.com/904724/101664848-9bc16380-3a4c-11eb-9e3a-faad60c86b2e.png)

```js
const { getPort, checkPort } = require('get-port-please')
// or
import { getPort, checkPort } from 'get-port-please'
// ESM
import { getPort, checkPort, getRandomPort, waitForPort } from 'get-port-please'
// CommonJS
const { getPort, checkPort, getRandomPort, waitForPort } = require('get-port-please')
```
```ts
function getPort(options?: GetPortOptions): Promise<number>
function checkPort(port: number, host?: string): Promise<number | false>
getPort(options?: GetPortOptions): Promise<number>
checkPort(port: number, host?: string): Promise<number | false>
waitForPort(port: number, options): Promise<number | false>
```

@@ -68,3 +71,3 @@

The host to check. Default is `process.env.HOST || '0.0.0.0'`
The host to check. Default is `process.env.HOST` otherwise all available hosts will be checked.

@@ -71,0 +74,0 @@ ### `memoDir` / `memoName`

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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