@burakboduroglu/portkill 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +136 -0
- package/dist/index.js +1308 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Burak Boduroglu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# **`.portkill`**
|
|
2
|
+
|
|
3
|
+
**Free stuck TCP ports in one command** — without memorizing `lsof`, `fuser`, and `kill` pipelines.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@burakboduroglu/portkill)
|
|
6
|
+
[](https://github.com/burakboduroglu/portkill/blob/main/LICENSE)
|
|
7
|
+
[](https://github.com/burakboduroglu/portkill/blob/main/package.json)
|
|
8
|
+
|
|
9
|
+
> The name reads like **`.portkill`** — a small, local dev utility (think `.env`-style prefix). The CLI binary is still `portkill`.
|
|
10
|
+
|
|
11
|
+
When Node or another stack prints `EADDRINUSE`, **`.portkill`** shows who owns the port, lets you **preview** (`--dry-run`), then stops only what you intend — or opens a **calm local web UI** on loopback.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Why **`.portkill`**
|
|
16
|
+
|
|
17
|
+
| Instead of… | You get… |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| Copy-pasting `lsof` / `xargs` / `kill -9` | One tool, clear output, safe defaults |
|
|
20
|
+
| Guessing PIDs | Process name + PID per port |
|
|
21
|
+
| Accidentally nuking the wrong thing | `--dry-run` first; `--gui` with browser confirm |
|
|
22
|
+
| Another Electron app | Node only; `--gui` is a tiny HTTP server on **127.0.0.1** / **::1** |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm i -g @burakboduroglu/portkill
|
|
30
|
+
portkill --version
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
No global install:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx @burakboduroglu/portkill --list
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Homebrew (tap)** — needs [@burakboduroglu/portkill on npm](https://www.npmjs.com/package/@burakboduroglu/portkill). Then:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
brew tap burakboduroglu/portkill
|
|
43
|
+
brew install portkill
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Tap: [github.com/burakboduroglu/homebrew-portkill](https://github.com/burakboduroglu/homebrew-portkill) · [docs/homebrew.md](https://github.com/burakboduroglu/portkill/blob/main/docs/homebrew.md)
|
|
47
|
+
|
|
48
|
+
**From source**
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
git clone https://github.com/burakboduroglu/portkill.git && cd portkill
|
|
52
|
+
npm install && npm run build
|
|
53
|
+
npm link # optional: puts `portkill` on PATH
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Quick start
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# What is listening everywhere?
|
|
62
|
+
portkill --list
|
|
63
|
+
|
|
64
|
+
# See what would happen (no signals sent)
|
|
65
|
+
portkill 3000 8080 --dry-run
|
|
66
|
+
|
|
67
|
+
# Stop listeners on those ports (prompts unless --force)
|
|
68
|
+
portkill 3000 8080
|
|
69
|
+
|
|
70
|
+
# Range (inclusive, max 4096 ports per range token)
|
|
71
|
+
portkill 9000-9002
|
|
72
|
+
|
|
73
|
+
# Optional local UI — same logic as the CLI
|
|
74
|
+
portkill --gui
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Press **Ctrl+C** to stop the GUI server. The printed URL is loopback-only.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## CLI flags (short)
|
|
82
|
+
|
|
83
|
+
| Flag | Meaning |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `-n`, `--dry-run` | Show targets only; do not send signals |
|
|
86
|
+
| `-f`, `--force` | Skip the terminal confirmation |
|
|
87
|
+
| `-s`, `--signal` | Signal to send (default `SIGTERM`) |
|
|
88
|
+
| `-l`, `--list` | List all TCP listeners |
|
|
89
|
+
| `--gui` | Open the local web UI |
|
|
90
|
+
| `-v`, `--verbose` | More detail on stderr |
|
|
91
|
+
|
|
92
|
+
Full reference: [CLI reference](https://github.com/burakboduroglu/portkill/blob/main/docs/cli-reference.md) · Exit codes and outcomes: same doc.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Requirements
|
|
97
|
+
|
|
98
|
+
- **Node.js ≥ 18**
|
|
99
|
+
- **macOS** or **Linux** — uses `lsof` (Linux may use `fuser` as fallback where applicable)
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Docs & product spec
|
|
104
|
+
|
|
105
|
+
| Doc | What it is |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| [PRD](https://github.com/burakboduroglu/portkill/blob/main/PRD.md) | Product requirements, roadmap |
|
|
108
|
+
| [Implementation](https://github.com/burakboduroglu/portkill/blob/main/docs/implementation.md) | Architecture & data flow |
|
|
109
|
+
| [Data dictionary](https://github.com/burakboduroglu/portkill/blob/main/DATA_DICTIONARY.md) | Types, GUI API shapes |
|
|
110
|
+
| [Security notes](https://github.com/burakboduroglu/portkill/blob/main/docs/security-notes.md) | GUI scope, `npm audit`, reporting |
|
|
111
|
+
| [Release](https://github.com/burakboduroglu/portkill/blob/main/docs/RELEASE.md) | `npm publish` (2FA), tags, checksums, tap updates |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Development
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm run build
|
|
119
|
+
npm test
|
|
120
|
+
npm run test:coverage
|
|
121
|
+
npm run lint
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Terminal colors use [chalk](https://github.com/chalk/chalk); set `NO_COLOR=1` to disable ([no-color.org](https://no-color.org/)).
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## npm vs GitHub README
|
|
129
|
+
|
|
130
|
+
**The same `README.md` is what npm shows** on [npmjs.com/package/@burakboduroglu/portkill](https://www.npmjs.com/package/@burakboduroglu/portkill) — it is listed in `package.json` `"files"`. Links to deep docs use **GitHub URLs** so they still work from the npm page (the `docs/` folder is not inside the published tarball).
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
MIT — see [LICENSE](https://github.com/burakboduroglu/portkill/blob/main/LICENSE).
|