# @types/kill-port

> TypeScript definitions for kill-port

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

## Install

```sh
npm install @types/kill-port
pnpm add @types/kill-port
yarn add @types/kill-port
bun add @types/kill-port
```

## Health

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

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2023-11-07 |
| First published | 2022-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

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

## Dependencies (2)

- [shell-exec](https://npm.io/package/shell-exec.md) ^1
- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 2.0.3 (latest) — 2023-11-07
- 2.0.0 (ts4.0) — 2022-08-26
- 2.0.2 — 2023-10-18
- 2.0.1 — 2023-09-14

## README

# Installation
> `npm install --save @types/kill-port`

# Summary
This package contains type definitions for kill-port (https://github.com/tiaanduplessis/kill-port).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/kill-port.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/kill-port/index.d.ts)
````ts
/// <reference types="node" />

import type { SuccessfulExec } from "shell-exec";

export = killPort;

/**
 * Kill the process running on given port.
 *
 * @param port Port where the process is running.
 * @param protocol Protocol for the port.
 *
 * @example
 * import kill = require('kill-port')
 * import * as http from 'http';
 * const port = 8080
 *
 * const server = http.createServer((req, res) => {
 *   res.writeHead(200, {
 *     'Content-Type': 'text/plain'
 *   })
 *
 *   res.end('Hi!')
 * })
 *
 * server.listen(port, () => {
 *   setTimeout(() => {
 *     // Currently you can kill ports running on TCP or UDP protocols
 *     kill(port, 'tcp')
 *       .then(console.log)
 *       .catch(console.log)
 *   }, 1000)
 * })
 */
declare function killPort(
    port: number,
    /** @default 'tcp' */
    protocol?: "tcp" | "udp",
): Promise<SuccessfulExec>;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:38 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [shell-exec](https://npmjs.com/package/shell-exec)

# Credits
These definitions were written by [BendingBender](https://github.com/BendingBender).

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