npkill - The solution to deleting node_modules easily, with style
Tags: javascript, node, webdev, showdev
Published: 2019-08-08 12:37:06

---
title: npkill - The solution to deleting node_modules easily, with style
published: true
description: One of my happiest memories related to software development was when I developed and distributed my first project among my friends and family. Although I learned to develop long before then, it was in 2003 when I developed the classic game [Arkanoid](https://en.wikipedia.org/wiki/Arkanoid) in assembler. Of course, this game couldn't be distributed online, since we had no internet at home, GitHub didn't exist, and, in my particular case, I didn't know any social networks for developers. Today, this story is a beautiful memory stored in my mind... And possibly in old floppies, kept in old boxes somewhere in my parent's house.
tags: javascript, node.js, beginners, webdev, showdev
cover_image: https://cdn-images-1.medium.com/max/1000/1*-_K3MQpxrodwOsOrI4bRLg.gif
canonical_url: https://carloscaballero.io/how-to-reach-your-goals-1000-github-stars-in-the-first-open-source-software
---

# Introduction
One of my happiest memories related to software development was when I developed and distributed my first project among my friends and family. Although I learned to develop long before then, it was in 2003 when I developed the classic game [Arkanoid](https://en.wikipedia.org/wiki/Arkanoid) in assembler. Of course, this game couldn't be distributed online, since we had no internet at home, GitHub didn't exist, and, in my particular case, I didn't know any social networks for developers. Today, this story is a beautiful memory stored in my mind... And possibly in old floppies, kept in old boxes somewhere in my parent's house.

Nowadays, I teach developers and I'm constantly encouraging my students to give visibility to all their projects, and to rely on the community, since it is there where they will find the best colleagues, outside the classroom.  The story I previously told would have gone very differently if it had happened today, since the first thing I would have done is to publish my project on all social networks, and find a good mentor to learn from her/him.  
Although you can't go back in time, I am pleased to present a project developed by two of my former vocational training students, which is published on GitHub. I think it is a great contribution to the community.

This tool solves a traditional problem that us *node.js* developers have when we install a large set of dependencies in our projects. The number of  _node_modules_ folders in our computer grows as we develop more projects.
More often than not, we don't remember where the _node_modules_ folders are stored, so it is very difficult to find and delete them.

![node_modules_meme](https://miro.medium.com/max/1198/1*DzW3ZKDzODwEawxzXSzimg.png)

These two students (now developers) have developed an _npm_ package which allows management of our old and heavy _node_modules_ folders. Therefore, I'm very happy to announce [**npkill**](https://github.com/voidcosmos/npkill).


![npkill](https://miro.medium.com/max/7935/1*GOk6v43CCwpxn2HJGlDEKg.png)

# [npkill](https://zaldih.tk/npkill/)

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. Yay!

Before to explain the easiest steps to get this essential tool, I'm going to show a GIF in which I've been using this tool in my laptop to save more than 1 GiB over a work folder. 

![ezgif.com-optimize](https://miro.medium.com/max/1999/1*-_K3MQpxrodwOsOrI4bRLg.gif)

### Installation

```bash
$ npm i -g npkill
```

### Usage

```bash
npkill
```

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

Move between the listed folders with <kbd>↓</kbd> <kbd>↑</kbd>, and use <kbd>Del</kbd> to delete the selected folder.

To exit, <kbd>Ctrl</kbd> + <kbd>c</kbd>.

#### Options

![options](https://miro.medium.com/max/1003/1*YBh1kCg37EO6T_HU3rVfVw.png)                                |

**Warning:** _In future versions some commands may change_

### Examples

- Search **node_modules** directories in your _projects_ directory:

```bash
npkill -d ~/projects

# other alternative:
cd ~/projects
npkill
```

- Automatically delete all **node_modules** that have sneaked into your backups:

```bash
npkill -d ~/backups/ --delete-all
```


# Conclusions
In this post, I've shown you two important topics:

1. This amazing tool which will be very helpful to manage our _node_modules_.
2. You are also able to develop an awesome project. A few months ago they were in class discovering fundamental concepts like "promises", "hoisting", "design patterns" or "tooling". Therefore, remember that you are able to do anything too.

My recommendation is to visit the [npkill official repo](https://github.com/voidcosmos/npkill), read the code and start helping them in this fun adventure of creating open-source content.


### More, More and More...
* [npkill GitHub](https://github.com/voidcosmos/npkill)
* [npkill Web](https://zaldih.tk/npkill/)

*****

*Originally published at [https://carloscaballero.io](https://carloscaballero.io/how-to-reach-your-goals-1000-github-stars-in-the-first-open-source-software).*