> 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/checkportavailable-port.md).

# checkPortAvailable(port)

Checks whether the given port is free (not in use).

```javascript
checkPortAvailable(port)
```

***

## Parameters

* **port** (<mark style="color:green;">number</mark>) – Port to check.

## Return Value

number – 1 if free, 0 if busy.

## Example

```javascript
// example

if (sdk.checkPortAvailable(1080) !== 1) {
  throw new Error("Port is unavailable");
}

```
