# @types/porty

> TypeScript definitions for porty

Latest version **3.1.0** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/porty
pnpm add @types/porty
yarn add @types/porty
bun add @types/porty
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2023-11-07 |
| First published | 2023-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51392 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/porty
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/porty
- npm.io page: https://npm.io/package/@types/porty

## Recent versions

- 3.1.0 (latest) — 2023-11-07

## README

# Installation
> `npm install --save @types/porty`

# Summary
This package contains type definitions for porty (https://github.com/AlexanderElias/porty#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/porty.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/porty/index.d.ts)
````ts
export interface FindOptions {
    /** Ports to avoid */
    avoids?: readonly number[] | undefined;
    /**
     * Minimum port.
     * @default 8000
     */
    min?: number | undefined;
    /**
     * Maximum port.
     * @default 10000
     */
    max?: number | undefined;
    /**
     * @internal
     * The current port to check.
     * This is an internal value, initialized and incremented
     * while {@link find} is run, and starts at {@link min} if unspecified.
     * It is unlikely that this needs to be set manually
     */
    port?: number | undefined;
}

/**
 * Test if a port on the system is free
 * @param port The port to test
 */
export function test(port: number): Promise<boolean>;

/**
 * Find an available port on the system in a range
 * @param options Optional config options
 * @returns The port found, if available
 */
export function find(options?: FindOptions): Promise<number>;
/**
 * Find an available port on the system in a range
 * @param min The minimum port. Defaults to 8000
 * @param max The maximum port. Defaults to 10000
 * @param avoids Ports to avoid
 */
export function find(min?: number, max?: number, avoids?: readonly number[]): Promise<number>;

export { find as get };

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 21:36:25 GMT
 * Dependencies: none

# Credits
These definitions were written by [Adam Thompson-Sharpe](https://github.com/MysteryBlokHed).

---
_Source: https://npm.io/package/@types/porty · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
