Skip to content

Commit 896141d

Browse files
authored
feat: enable deleting with "DELete" in addition to "SPACE" (#163)
* feat: enable deleting with the "DELete" key in addition to "SPACE" key * docs: mention the DEL key funtionality
1 parent 9c6919b commit 896141d

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ $ npx npkill
8282

8383
By default, npkill will scan for node_modules starting at the path where `npkill` command is executed.
8484

85-
Move between the listed folders with <kbd>↓</kbd> <kbd>↑</kbd>, and use <kbd>Space</kbd> to delete the selected folder.
85+
Move between the listed folders with <kbd>↓</kbd> <kbd>↑</kbd>, and use <kbd>Space</kbd> or <kbd>Del</kbd> to delete the selected folder.
8686
You can also use <kbd>j</kbd> and <kbd>k</kbd> to move between the results
8787

8888
To exit, <kbd>Q</kbd> or <kbd>Ctrl</kbd> + <kbd>c</kbd> if you're brave.

src/constants/cli.constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const OPTIONS: ICliOptions[] = [
7878

7979
export const HELP_HEADER = `This tool allows you to list any node_modules directories in your system, as well as the space they take up. You can then select which ones you want to erase to free up space.
8080
┌------ CONTROLS --------------------
81-
🭲 SPACE: delete selected result
81+
🭲 SPACE, DEL: delete selected result
8282
🭲 Cursor UP, k: move up
8383
🭲 Cursor DOWN, j: move down
8484
🭲 h, d, Ctrl+d, PgUp: move one page down

src/ui/components/results.ui.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class ResultsUi extends HeavyUi implements InteractiveUi {
3232
up: () => this.cursorUp(),
3333
down: () => this.cursorDown(),
3434
space: () => this.delete(),
35+
delete: () => this.delete(),
3536
j: () => this.cursorDown(),
3637
k: () => this.cursorUp(),
3738
h: () => this.cursorPageDown(),

0 commit comments

Comments
 (0)