portclean 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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/cli.js +4 -3
  3. package/package.json +2 -2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tejaswan Kalluri
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/cli.js CHANGED
@@ -115,7 +115,7 @@ async function handlePort(port) {
115
115
  } else if (args.all) {
116
116
  // --all without --force: single confirmation
117
117
  const confirmed = await prompt(
118
- `Kill all ${processes.length} process(es) on port ${port}? (y/N) `
118
+ `Kill all ${processes.length} process(es) on port ${port}? (Y/n) `
119
119
  );
120
120
  if (confirmed) {
121
121
  for (const proc of processes) {
@@ -127,7 +127,7 @@ async function handlePort(port) {
127
127
  // Without --all: prompt per process
128
128
  for (const proc of processes) {
129
129
  const confirmed = await prompt(
130
- `Process ${proc.pid} (${proc.command}) is using port ${port}. Kill it? (y/N) `
130
+ `Process ${proc.pid} (${proc.command}) is using port ${port}. Kill it? (Y/n) `
131
131
  );
132
132
  if (confirmed) {
133
133
  await killProcess(proc.pid, proc.command);
@@ -326,7 +326,8 @@ function prompt(question) {
326
326
 
327
327
  rl.question(question, (answer) => {
328
328
  rl.close();
329
- resolve(answer.toLowerCase() === 'y');
329
+ const response = answer.trim().toLowerCase();
330
+ resolve(response === '' || response === 'y' || response === 'yes');
330
331
  });
331
332
  });
332
333
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portclean",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Kill processes using specific ports on macOS, Linux, and Windows",
5
5
  "type": "module",
6
6
  "main": "cli.js",
@@ -8,7 +8,7 @@
8
8
  "portclean": "cli.js"
9
9
  },
10
10
  "scripts": {
11
- "test": "node --test test/*.test.js",
11
+ "test": "node --test",
12
12
  "smoke": "node cli.js --help"
13
13
  },
14
14
  "keywords": [