portcleaner 1.0.0 β†’ 1.0.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.
Files changed (2) hide show
  1. package/README.md +100 -107
  2. package/package.json +8 -2
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # 🧹 Clean Ports (cleanports CLI)
1
+ # 🧹 PortCleaner CLI
2
2
 
3
3
  Instantly kill stuck development servers and free your ports.
4
4
 
5
- `cleanports` is a lightweight CLI tool that scans your system for running development servers (Node, Bun, Deno, Python, Docker proxies, etc.) and automatically releases the ports they are occupying.
5
+ `portcleaner` is a lightweight CLI tool that scans your system for running development servers (Node, Bun, Deno, Python, Docker, etc.) and automatically releases the ports they are occupying.
6
6
 
7
7
  No more:
8
8
 
@@ -10,19 +10,21 @@ No more:
10
10
  EADDRINUSE: address already in use :::3000
11
11
  ```
12
12
 
13
+ πŸ“¦ npm package: [https://www.npmjs.com/package/portcleaner](https://www.npmjs.com/package/portcleaner)
14
+
13
15
  ---
14
16
 
15
- ## πŸ“š Table of Contents
17
+ ## Table of Contents
16
18
 
17
19
  * [Why this exists](#why-this-exists)
18
20
  * [Features](#features)
19
21
  * [Supported Platforms](#supported-platforms)
20
- * [Quick Install (Automatic - Recommended)](#quick-install-automatic-recommended)
21
- * [Manual Installation (Local Development)](#manual-installation-local-development)
22
+ * [Quick Install (Recommended)](#quick-install-recommended)
23
+ * [Manual Installation (For Contributors)](#manual-installation-for-contributors)
22
24
  * [Usage](#usage)
23
- * [Add to your project workflow](#add-to-your-project-workflow)
24
- * [Uninstall / Disable cleanports](#uninstall--disable-cleanports)
25
- * [Re-enable later](#re-enable-later)
25
+ * [Use inside your project](#use-inside-your-project)
26
+ * [Uninstall / Disable](#uninstall--disable)
27
+ * [Reinstall later](#reinstall-later)
26
28
  * [Requirements](#requirements)
27
29
  * [How it works](#how-it-works)
28
30
  * [Troubleshooting](#troubleshooting)
@@ -41,7 +43,7 @@ During development, servers often **do not shut down properly**:
41
43
  * Docker containers
42
44
  * AI coding agents
43
45
 
44
- Even after closing the terminal, the process continues running in the background and blocks ports.
46
+ Even after closing the terminal, the process keeps running in the background and blocks ports.
45
47
 
46
48
  Developers repeatedly run:
47
49
 
@@ -50,11 +52,11 @@ lsof -i :3000
50
52
  kill -9 <PID>
51
53
  ```
52
54
 
53
- This tool automates that entire process.
55
+ `portcleaner` automates this entire process.
54
56
 
55
57
  ---
56
58
 
57
- ## ✨ Features
59
+ ## Features
58
60
 
59
61
  * Detects active listening ports
60
62
  * Finds development servers automatically
@@ -65,165 +67,155 @@ This tool automates that entire process.
65
67
 
66
68
  ---
67
69
 
68
- ## πŸ’» Supported Platforms
70
+ ## Supported Platforms
71
+
72
+ | OS | Support |
73
+ | ---------------------------------- | ------------ |
74
+ | macOS | Full support |
75
+ | Linux (Ubuntu, Debian, Arch, etc.) | Full support |
76
+ | Windows (WSL) | Supported |
77
+ | Windows PowerShell / CMD | Limited |
69
78
 
70
- | OS | Support |
71
- | ---------------------------------- | -------------- |
72
- | macOS | βœ… Full support |
73
- | Linux (Ubuntu, Debian, Arch, etc.) | βœ… Full support |
74
- | Windows (WSL) | βœ… Supported |
75
- | Windows (PowerShell / CMD native) | ⚠️ Limited |
79
+ ### Windows users
76
80
 
77
- ### Important for Windows users
81
+ Windows does not include the `lsof` utility by default.
78
82
 
79
- Windows does not include the `lsof` utility.
80
- Please run this tool inside:
83
+ Please run the tool inside:
81
84
 
82
85
  * WSL (recommended)
83
86
  * Git Bash
84
87
 
85
88
  ---
86
89
 
87
- ## πŸš€ Quick Install (Automatic β€” Recommended)
90
+ ## Quick Install (Recommended)
88
91
 
89
- This is the **normal user method**.
92
+ Install globally from npm:
90
93
 
91
94
  ```
92
- npm install -g clean-ports
95
+ npm install -g portcleaner
93
96
  ```
94
97
 
95
- After installation, simply run:
98
+ Then run:
96
99
 
97
100
  ```
98
- cleanports
101
+ portcleaner
99
102
  ```
100
103
 
101
- That’s it. No linking. No configuration.
102
-
103
- The installer automatically:
104
-
105
- * registers the CLI command
106
- * grants permissions
107
- * verifies environment
104
+ No configuration needed.
108
105
 
109
106
  ---
110
107
 
111
- ## πŸ›  Manual Installation (Local Development)
108
+ ## Manual Installation (For Contributors)
112
109
 
113
- Use this if you cloned the repository.
110
+ If you cloned the repository:
114
111
 
115
112
  ```
116
- git clone https://github.com/<your-username>/clean-ports.git
117
- cd clean-ports
113
+ git clone https://github.com/<your-username>/port_cleaner.git
114
+ cd port_cleaner
118
115
  npm install
119
116
  npm link
120
117
  ```
121
118
 
122
- Now the command works globally:
119
+ Now you can run:
123
120
 
124
121
  ```
125
- cleanports
122
+ portcleaner
126
123
  ```
127
124
 
128
125
  ---
129
126
 
130
- ## ▢️ Usage
131
-
132
- Run:
127
+ ## Usage
133
128
 
134
129
  ```
135
- cleanports
130
+ portcleaner
136
131
  ```
137
132
 
138
- Example output:
133
+ Example:
139
134
 
140
135
  ```
141
- πŸ” Scanning for running dev servers...
136
+ Scanning for running dev servers...
142
137
 
143
- ⚠️ Found running servers:
138
+ Found running servers:
139
+ β€’ node on port 3000
140
+ β€’ docker-proxy on port 5432
144
141
 
145
- β€’ node running on port 3000 (PID 5542)
146
- β€’ docker-proxy running on port 5432 (PID 8821)
142
+ Cleaning ports...
147
143
 
148
- 🧹 Cleaning ports...
144
+ Killed node on port 3000
145
+ Killed docker-proxy on port 5432
149
146
 
150
- ❌ Killed node on port 3000
151
- ❌ Killed docker-proxy on port 5432
152
-
153
- πŸŽ‰ All development ports cleaned!
147
+ All development ports cleaned!
154
148
  ```
155
149
 
156
150
  ---
157
151
 
158
- ## πŸ” Add to your project workflow
152
+ ## Use inside your project
159
153
 
160
- You can automatically clean ports before starting your app.
154
+ Automatically clean ports before starting your app.
161
155
 
162
- Add inside any project's `package.json`:
156
+ Add to `package.json`:
163
157
 
164
158
  ```
165
159
  "scripts": {
166
- "dev": "cleanports && npm run start"
160
+ "dev": "portcleaner && next dev"
167
161
  }
168
162
  ```
169
163
 
170
- or for Next.js:
164
+ or:
171
165
 
172
166
  ```
173
- "dev": "cleanports && next dev"
167
+ "scripts": {
168
+ "dev": "portcleaner && nodemon src/index.js"
169
+ }
174
170
  ```
175
171
 
176
- Now every time your project starts β†’ ports are cleaned first.
172
+ Now every time the project starts β†’ ports are freed first.
177
173
 
178
174
  ---
179
175
 
180
- ## ❌ Uninstall / Disable cleanports
176
+ ## Uninstall / Disable
181
177
 
182
- If you no longer want the `cleanports` command on your system:
183
-
184
- ### If installed globally (recommended install)
178
+ To remove the command from your system:
185
179
 
186
180
  ```
187
- npm uninstall -g clean-ports
181
+ npm uninstall -g portcleaner
188
182
  ```
189
183
 
190
- ### If installed via `npm link`
191
-
192
- Inside the project folder:
184
+ If installed via `npm link`:
193
185
 
194
186
  ```
195
- npm unlink -g clean-ports
187
+ npm unlink -g portcleaner
196
188
  ```
197
189
 
198
- After uninstalling, running:
190
+ After uninstalling:
199
191
 
200
192
  ```
201
- cleanports
193
+ portcleaner
202
194
  ```
203
195
 
204
196
  will no longer work.
205
197
 
206
198
  ---
207
199
 
208
- ## πŸ”„ Re-enable later
200
+ ## Reinstall later
209
201
 
210
- You can always reinstall:
202
+ You can enable it again anytime:
211
203
 
212
204
  ```
213
- npm install -g clean-ports
205
+ npm install -g portcleaner
214
206
  ```
215
207
 
216
208
  The command will immediately start working again.
217
209
 
218
210
  ---
219
211
 
220
- ## πŸ“¦ Requirements
212
+ ## Requirements
221
213
 
222
- * Node.js v16 or newer
223
- * macOS or Linux (native support)
214
+ * Node.js 16 or newer
215
+ * macOS or Linux (native)
224
216
  * Windows requires WSL or Git Bash
225
217
 
226
- Check Node version:
218
+ Check:
227
219
 
228
220
  ```
229
221
  node -v
@@ -231,15 +223,15 @@ node -v
231
223
 
232
224
  ---
233
225
 
234
- ## βš™οΈ How it works
226
+ ## How it works
235
227
 
236
- The CLI internally runs:
228
+ Internally the CLI runs:
237
229
 
238
230
  ```
239
231
  lsof -i -P -n | grep LISTEN
240
232
  ```
241
233
 
242
- It filters only known development processes:
234
+ It filters development processes such as:
243
235
 
244
236
  * node
245
237
  * bun
@@ -248,59 +240,60 @@ It filters only known development processes:
248
240
  * docker
249
241
  * docker-proxy
250
242
 
251
- Then safely terminates them using system signals.
243
+ Then safely terminates them.
252
244
 
253
245
  ---
254
246
 
255
- ## 🧯 Troubleshooting
247
+ ## Troubleshooting
256
248
 
257
- ### `cleanports: command not found`
249
+ ### `portcleaner: command not found`
258
250
 
259
- Restart terminal or run:
251
+ Restart terminal or reopen shell.
260
252
 
261
- ```
262
- source ~/.zshrc
263
- ```
253
+ ### Nothing was cleaned
264
254
 
265
- ---
266
-
267
- ### Permission denied
255
+ Check if a port is actually in use:
268
256
 
269
257
  ```
270
- chmod +x bin/cleanports.js
258
+ lsof -i :3000
271
259
  ```
272
260
 
273
- ---
274
-
275
- ### Nothing was killed
261
+ ### Windows not working
276
262
 
277
- Verify something is actually using a port:
263
+ Use WSL:
278
264
 
279
265
  ```
280
- lsof -i :3000
266
+ wsl
267
+ npm install -g portcleaner
268
+ portcleaner
281
269
  ```
282
270
 
283
271
  ---
284
272
 
285
- ## 🀝 Contributing
273
+ ## Contributing
286
274
 
287
275
  Pull requests are welcome.
288
276
 
289
- Possible improvements:
277
+ Ideas:
290
278
 
291
- * interactive confirmation mode
292
- * port range filtering
293
- * Windows native support
294
- * database port exclusions (5432, 27017)
279
+ * port specific cleaning (`portcleaner 3000`)
280
+ * interactive mode
281
+ * skip database ports (5432, 27017)
282
+ * native Windows support
295
283
 
296
284
  ---
297
285
 
298
- ## πŸ“„ License
286
+ ## License
299
287
 
300
- MIT
288
+ [MIT](LICENSE)
301
289
 
302
290
  ---
303
291
 
304
- ## πŸ‘¨β€πŸ’» Author
292
+ ## Author
293
+
294
+ Created and maintained by [Shubhashish Chakraborty](https://imshubh.site) <br/>
295
+ For any queries, reach out via email at shubhashish147@gmail.com. <br/>
305
296
 
306
- Shubhashish Chakraborty
297
+ [![Twitter](https://img.shields.io/badge/Twitter-%231DA1F2.svg?logo=Twitter&logoColor=white)](https://twitter.com/__Shubhashish__)
298
+ [![GitHub](https://img.shields.io/badge/GitHub-%2312100E.svg?logo=github&logoColor=white)](https://github.com/Shubhashish-Chakraborty)
299
+ [![LinkedIn](https://img.shields.io/badge/LinkedIn-%230077B5.svg?logo=linkedin&logoColor=white)](https://linkedin.com/in/shubhashish-chakraborty)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portcleaner",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A CLI utility that detects and terminates stuck development servers to free ports.",
5
5
  "main": "index.js",
6
6
  "preferGlobal": true,
@@ -13,7 +13,13 @@
13
13
  "engines": {
14
14
  "node": ">=16"
15
15
  },
16
- "keywords": ["ports", "kill-port", "dev-tools", "node", "cli"],
16
+ "keywords": [
17
+ "ports",
18
+ "kill-port",
19
+ "dev-tools",
20
+ "node",
21
+ "cli"
22
+ ],
17
23
  "author": "Shubhashish Chakraborty",
18
24
  "license": "MIT",
19
25
  "type": "commonjs"