> 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/getportswithlimit-limit.md).

# getPortsWithLimit(limit)

Retrieves up to limit ports from the current SDK settings.

```javascript
getPortsWithLimit(limit)
```

***

## Parameters

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

## Return Value

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

## Example

```javascript
// example

const slice = sdk.getPortsWithLimit(10);
console.log(slice);

```
