> For the complete documentation index, see [llms.txt](https://docs.9proxy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.9proxy.com/developers/sdk/sdk-nodejs/functions/getportsfreewithlimit-limit.md).

# getPortsFreeWithLimit(limit)

Retrieves up to limit free (unused) ports from the current settings.

```javascript
getPortsFreeWithLimit(limit)
```

***

## Parameters

* **limit** (<mark style="color:green;">number</mark>) – Maximum number of free ports to return.

## Return Value

number\[] or Buffer (binding dependent) : limit free (unused) ports from the current settings.

## Example

```javascript
// example

const free = sdk.getPortsFreeWithLimit(5);

```
