{"id":19850515,"url":"https://github.com/mroth/deepclean","last_synced_at":"2025-05-01T23:30:24.018Z","repository":{"id":57537834,"uuid":"143034855","full_name":"mroth/deepclean","owner":"mroth","description":":wastebasket: scan and remove junk files from your source code directories","archived":false,"fork":false,"pushed_at":"2024-01-01T19:41:38.000Z","size":52,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-06-20T03:29:08.132Z","etag":null,"topics":["cli-utilities","developer-tools","maintenance"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mroth.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-31T15:43:32.000Z","updated_at":"2024-01-04T15:50:20.000Z","dependencies_parsed_at":"2023-10-01T21:50:03.012Z","dependency_job_id":"7c067add-030f-42a9-b0ca-75c0bdcd04bf","html_url":"https://github.com/mroth/deepclean","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fdeepclean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fdeepclean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fdeepclean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fdeepclean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mroth","download_url":"https://codeload.github.com/mroth/deepclean/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224280875,"owners_count":17285538,"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":["cli-utilities","developer-tools","maintenance"],"created_at":"2024-11-12T13:26:27.038Z","updated_at":"2024-11-12T13:26:27.721Z","avatar_url":"https://github.com/mroth.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deepclean\n\n\u003e be disrespectful to filesystem dirt :sparkles::wastebasket::sparkles:\n\nI often have a bunch of junk dependency files sitting around in my source folder\nthat I don't actually need. Periodically I want to clean them up on inactive\nprojects, as I recently discovered when I wanted to transfer my src dir to a new\ncomputer, and it was taking forever due to over _half a million_ junk files in\n`node_modules` directories.\n\n\u003cimg width=\"600\" src=\"docs/demo.svg\"\u003e\n\nCurrently looks for the following:\n - `.bundle` (Ruby Bundler)\n - `node_modules` (NodeJS NPM)\n - `target` (Rust Cargo, Scala SBT)\n\nHowever it's easy to overrride this list.\n\nDeepclean is very fast -- it will take advantage of multiple cores on your\nmachine by gathering statistics for matched directories in parallel.\n\nNothing is actually deleted at the moment due to paranoia, just surfaced in the\nUI so the user can decide on their own how to handle.\n\n_TODO: only recommend these for deletion if they are `.gitignore`'d, not tracked\nin git._\n\n## Installation\n\nGrab a compiled binary from the [releases][1] page, or on macOS with [homebrew][2]\nyou can `brew install mroth/formulas/deepclean`.\n\n[1]: https://github.com/mroth/deepclean/releases\n[2]: https://brew.sh\n\n## Usage\n\n    Usage: deepclean [options] [dir]\n\n    Options:\n      -sort\n          sort output\n      -target string\n          dirs to scan for (default \"node_modules,.bundle,target\")\n\nWill scan the current directory or `dir` if provided.\n\n## Errata\n\n### Why not `find`?\n\nIt is possible to do something similar with a monster shell command.\n\n```bash\nfind . \\( \\\n      -name 'node_modules' \\\n      -o -name '.bundle' \\\n      -o -name 'target' \\\n    \\)  -prune \\\n    -exec sh -c 'echo \"$(find \"$0\" | wc -l)\\t$(du -sh \"$0\")\"' {} \\;\n```\n\nOn my machine that takes about ~3.5sec total. In contrast deepclean is ~670ms.\nI'm on a fairly fast machine[*] and don't have a super large src dir. I imagine\nthat these numbers should scale similarly on very large directories or slower\ndisks.\n\n[*]: 8-core Xeon, 2xSSD array in RAID-0.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroth%2Fdeepclean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmroth%2Fdeepclean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroth%2Fdeepclean/lists"}