• Stars
    star
    335
  • Rank 125,904 (Top 3 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ—‘๏ธ Easily remove the node_modules folder of non-active projects

wipe-modules Build Status

A little agent that removes the node_modules folder of non-active projects ๐Ÿ—‘๏ธ

Why

If you're a Javascript developer, you know the node_modules directory holds thousands or even millions of files, resulting in taking a lot of space in your hard disk.

Enter wipe-modules, a little agent that wipes (eats, literally) that big node_modules directory of non-active projects.

Why in Earth would you want to have those monster-sized node_modules folders on inactive projects? You got your package.json to recreate it whenever you want, right?

Watch wipe-modules in action! ๐Ÿ“บ

Inspiration

I got the idea when I saw this Wes Bos tweet.

6 hours into a time machine restore - node_modules with millions of files is killing me pic.twitter.com/2KirOXF2v2

-- Wes Bos (@wesbos) May 1, 2017

Problem solved now! ๐ŸŽ‰๐ŸŽŠ

Install

Can be installed with npm, bpkg or curl.

npm

$ npm install --global wipe-modules

That's it! ๐Ÿ˜„

bpkg

$ bpkg install -g bntzio/wipe-modules

Done! ๐Ÿ˜ƒ

curl

$ curl -L https://raw.githubusercontent.com/bntzio/wipe-modules/master/wipe-modules.sh -o ~/bin/wipe-modules && chmod +x ~/bin/wipe-modules

All set! ๐Ÿ™‚

If you're using zsh or a different shell, make sure to have ~/bin in your $PATH.

Usage

$ wipe-modules --help

  Usage: wipe-modules [path] [days] [options]

  Path:
    The full path of your code directory

  Days:
    The days you want to set to mark projects as inactive

  Options:
    -D, --dry      Only show node_modules to be removed

  Example: wipe-modules ~/code 30

  That will remove the node_modules of your ~/code projects
  whose been inactive for 30 days or more.

Using cron

wipe-modules can be executed as a background job using using cron โŒ›

To set a cron job, download the cron-file file included in the repo.

$ curl -L https://raw.githubusercontent.com/bntzio/wipe-modules/master/cron-file -o ~/Desktop/cron-file

This will download the cron-file and put it in your ~/Desktop location.

The default cron-file holds the following syntax:

0 11 * * * $HOME/bin/wipe-modules ~/code_dir 30

That is the crontab (cron table) file, it instructs cron to run the wipe-modules ~/code_dir 30 script everyday at 11:00 am.

Edit the cron-file to match your own needs, see how to set up a crontab for more info.

Note: depending on how you installed wipe-modules you need to set the correct path of the wipe-modules.sh shell script in your cron-file for cron to find and execute the script.

Now set the cron-file crontab file in cron using:

$ crontab ~/Desktop/cron-file

And you're done! ๐Ÿ‘

To check if you've successfully added your crontab type:

$ crontab -l

It should display your crontab.

To edit a crontab, use crontab -e and to delete all crontabs use crontab -r.

Note that crontab -r will destroy all your crontabs, that's why it's a good idea to keep your crontab commands in a cron-file.

Cron is only supported in unix operating systems.

wipe-modules in action!

Watch this screencast to learn how to use wipe-modules and see what it does.

asciicast

License

MIT ยฉ Enrique Benitez

More Repositories

1

gatsby-theme-superstylin

๐Ÿ’… A Gatsby Theme with styled-components
JavaScript
171
star
2

gatsby-starter-alchemy

โœจ๐Ÿ”ฎ A Gatsby starter with PostCSS powers
CSS
25
star
3

gatsby-generator

๐ŸŽฐ Generate Gatsby Starters in Seconds
TypeScript
23
star
4

whatsapp-monitor

Continuously check if someone is online ๐Ÿ‘€
Python
19
star
5

bntz.io

๐Ÿก My digital home
TypeScript
12
star
6

tour-aframe

A Virtual Reality Tour using A-Frame
HTML
7
star
7

github-classic

Chrome extension to return to the classic GitHub look ๐Ÿ˜Ž
CSS
6
star
8

whatsapp-debt

Automating the tedious task of collecting debts ๐Ÿ’ฐ
Python
6
star
9

fast-license

Generate licenses for your open source projects the fast way ๐Ÿƒ๐Ÿ’จ
JavaScript
5
star
10

bookmark-this

Social bookmarking with email integration โญ
Ruby
4
star
11

treminal

Manage Trello from the Terminal ๐Ÿ™Œ
JavaScript
4
star
12

old-site

My personal site built w/Gatsby and some magic ๐ŸŽฉโœจ
JavaScript
3
star
13

crab.so

Decentralized Communities ๐Ÿฆ€
TypeScript
3
star
14

warm-welcome-action

GitHub Action to give a warm welcome on PRs ๐Ÿ’–
TypeScript
3
star
15

cliip

Get your ip info with a single cli command ๐Ÿ’ป
JavaScript
3
star
16

saladom

Super Simple Healthy Food Delivery App ๐Ÿ๐Ÿ“ฑ
JavaScript
3
star
17

avataaars-api

An API for Avataaars ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ
JavaScript
3
star
18

wikitec

Social knowledge wiki-style platform for students ๐Ÿ“
Ruby
2
star
19

trello-json-parser

Transform your exported json trello data into a human readable format!
Python
2
star
20

flexbox

Learning Flexbox ๐Ÿญ with @wesbos ๐Ÿ˜ƒ
CSS
2
star
21

notes-node

Nodejs notes cli application
JavaScript
2
star
22

rejection-challenges

A list of challenges to overcome fear of rejection โœ‹
2
star
23

node-web-server

JavaScript
1
star
24

electron-pics

Electron app to visualize pictures ๐Ÿ–ผ๏ธ
HTML
1
star
25

gatsby-theme-personal

๐Ÿ’„ My personal Gatsby theme (used in bntz.io)
TypeScript
1
star
26

stop-da-photos

Automatically close the Photos app when an iPhone connects to your mac ๐Ÿ”Œ๐Ÿ“ฑ
1
star
27

starbucks-reviews-api

API for the Starbucks Reviews Challenge for Eva Frontend Applicants โ˜• โญ
JavaScript
1
star
28

bitso-contentful-example

JavaScript
1
star
29

bloccit

Reddit clone made in rails ๐Ÿ‘ฝ
Ruby
1
star
30

gladys.love

A love game I made to my girlfriend ๐Ÿ’–
JavaScript
1
star
31

reaction

A super simple yet powerful react + redux boilerplate
JavaScript
1
star
32

likelihood

Is it true?
JavaScript
1
star
33

parallels-oculus

Unity3D oculus rift horror game ๐Ÿ’€
C#
1
star
34

clean-mac

Freeze your keyboard to clean your mac โœจ
1
star
35

ready-set-hunt

The Ultimate Product Hunt Launch Checklist โœ…
Vue
1
star
36

fast-readme

1
star
37

garyquotes

Super Awesome Gary Vaynerchuk Wallpaper Quotes ๐Ÿ‘Š
1
star
38

vue-lastfm

A very simple vue app that grab n' show artists from the lastfm api ๐ŸŽค
Vue
1
star
39

bitso-sanity-example-old

bitso-sanity-example
JavaScript
1
star
40

pull-request-automerge

Just trying the auto-merge Github feature
1
star
41

turbo-prisma

TypeScript
1
star
42

elixir-cards

Elixir
1
star
43

bitso-contentful-example-old

JavaScript
1
star
44

datocms-bitso-datocms-example

JavaScript
1
star
45

notion-api

A collection of Notion API wrappers for NodeJS, Python and Go
JavaScript
1
star
46

react-siwe

JavaScript
1
star
47

uniswap-ui

JavaScript
1
star
48

use-siwe

JavaScript
1
star
49

antidote

A magic potion that cures unmaintained libraries ๐Ÿงช๐Ÿ“ฆ
JavaScript
1
star
50

action-tests

JavaScript
1
star
51

passport-siwe

JavaScript
1
star
52

bitso-sanity-example

JavaScript
1
star
53

bet-with-friends

Betting system for friends ๐Ÿ’ธ [unfinished]
Ruby
1
star
54

secret-santa

1
star
55

bird-hunter

[DEPRECATED] Tweet Product Hunt upvoters of any product ๐Ÿ˜ผ
Ruby
1
star
56

monopoly-cli

Stop using those paper bills and speed up your game
1
star
57

node-pacman

Give Pacman some node_modules to eat ๐Ÿ’
JavaScript
1
star
58

bitso-sanity-example-studio

JavaScript
1
star
59

ssc-nft-staking

Discover how much $SHDW current Shadowy Super Coders NFT listings hold โš›๏ธโšก
TypeScript
1
star
60

twitter-clone

A twitter clone made using rails + react with flux architecture ๐Ÿฆ
JavaScript
1
star
61

weblate-sample

JavaScript
1
star