{"id":13448498,"url":"https://github.com/bntzio/wipe-modules","last_synced_at":"2025-04-05T17:06:16.146Z","repository":{"id":49108071,"uuid":"89959451","full_name":"bntzio/wipe-modules","owner":"bntzio","description":"🗑️ Easily remove the node_modules folder of non-active projects","archived":false,"fork":false,"pushed_at":"2023-01-30T13:20:04.000Z","size":5855,"stargazers_count":353,"open_issues_count":4,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T16:04:44.562Z","etag":null,"topics":["bash","cleanup","cron","cron-jobs","hacktoberfest","javascript","js","node-modules","nodejs","performance","shell","tools","unix","utilities"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bntzio.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-01T20:18:34.000Z","updated_at":"2025-03-21T03:30:57.000Z","dependencies_parsed_at":"2023-02-16T07:45:42.872Z","dependency_job_id":null,"html_url":"https://github.com/bntzio/wipe-modules","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bntzio%2Fwipe-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bntzio%2Fwipe-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bntzio%2Fwipe-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bntzio%2Fwipe-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bntzio","download_url":"https://codeload.github.com/bntzio/wipe-modules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cleanup","cron","cron-jobs","hacktoberfest","javascript","js","node-modules","nodejs","performance","shell","tools","unix","utilities"],"created_at":"2024-07-31T05:01:47.274Z","updated_at":"2025-04-05T17:06:16.124Z","avatar_url":"https://github.com/bntzio.png","language":"Shell","readme":"# wipe-modules [![Build Status](https://travis-ci.org/bntzio/wipe-modules.svg?branch=master)](https://travis-ci.org/bntzio/wipe-modules)\n\n\u003e A little agent that removes the node_modules folder of non-active projects 🗑️\n\n![](agent-gir.gif)\n\n\n## Why\n\nIf 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.\n\nEnter `wipe-modules`, a little agent that wipes (eats, literally) that big `node_modules` directory of non-active projects.\n\nWhy 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?\n\n[Watch wipe-modules in action!](https://github.com/bntzio/wipe-modules#wipe-modules-in-action) 📺\n\n\n## Inspiration\n\nI got the idea when I saw this [Wes Bos](https://twitter.com/wesbos) tweet.\n\n\u003e 6 hours into a time machine restore - node_modules with millions of files is killing me [pic.twitter.com/2KirOXF2v2](https://t.co/2KirOXF2v2)\n\n\u003e -- Wes Bos (@wesbos) [May 1, 2017](https://twitter.com/wesbos/status/859128736989544448)\n\nProblem solved now! 🎉🎊\n\n\n## Install\n\nCan be installed with [npm](https://www.npmjs.com/), [bpkg](http://www.bpkg.io/) or [curl](https://curl.haxx.se/).\n\n### npm\n\n```console\n$ npm install --global wipe-modules\n```\n\nThat's it! 😄\n\n### bpkg\n\n```console\n$ bpkg install -g bntzio/wipe-modules\n```\n\nDone! 😃\n\n### curl\n\n```console\n$ curl -L https://raw.githubusercontent.com/bntzio/wipe-modules/master/wipe-modules.sh -o ~/bin/wipe-modules \u0026\u0026 chmod +x ~/bin/wipe-modules\n```\n\nAll set! 🙂\n\nIf you're using zsh or a different shell, make sure to have `~/bin` in your `$PATH`.\n\n## Usage\n\n```\n$ wipe-modules --help\n\n  Usage: wipe-modules [path] [days] [options]\n\n  Path:\n    The full path of your code directory\n\n  Days:\n    The days you want to set to mark projects as inactive\n\n  Options:\n    -D, --dry      Only show node_modules to be removed\n\n  Example: wipe-modules ~/code 30\n\n  That will remove the node_modules of your ~/code projects\n  whose been inactive for 30 days or more.\n```\n\n\n## Using cron\n\n`wipe-modules` can be executed as a background job using using [cron](https://en.wikipedia.org/wiki/Cron) ⌛\n\nTo set a cron job, download the `cron-file` file included in the repo.\n\n```\n$ curl -L https://raw.githubusercontent.com/bntzio/wipe-modules/master/cron-file -o ~/Desktop/cron-file\n```\n\nThis will download the `cron-file` and put it in your `~/Desktop` location.\n\nThe default `cron-file` holds the following syntax:\n\n`0 11 * * * $HOME/bin/wipe-modules ~/code_dir 30`\n\nThat is the crontab (cron table) file, it instructs cron to run the `wipe-modules ~/code_dir 30` script everyday at 11:00 am.\n\nEdit the `cron-file` to match your own needs, see [how to set up a crontab](https://en.wikipedia.org/wiki/Cron#Overview) for more info.\n\nNote: 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.\n\nNow set the `cron-file` crontab file in cron using:\n\n```\n$ crontab ~/Desktop/cron-file\n```\n\nAnd you're done! 👏\n\nTo check if you've successfully added your crontab type:\n\n```\n$ crontab -l\n```\n\nIt should display your crontab.\n\nTo edit a crontab, use `crontab -e` and to delete all crontabs use `crontab -r`.\n\nNote 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`.\n\nCron is only supported in unix operating systems.\n\n\n## `wipe-modules` in action!\n\nWatch this screencast to learn how to use `wipe-modules` and see what it does.\n\n[![asciicast](https://asciinema.org/a/119319.png)](https://asciinema.org/a/119319)\n\n\n## License\n\nMIT © [Enrique Benitez](https://bntz.io)\n","funding_links":[],"categories":["Shell","Development","For Developers"],"sub_categories":["Npm","Directory Navigation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbntzio%2Fwipe-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbntzio%2Fwipe-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbntzio%2Fwipe-modules/lists"}