@@ -104,6 +104,7 @@ Options:
104104 -w, --workspace Enable workspace/monorepo mode
105105 --workspace-root <dir> Specify workspace root (auto-detected if not provided)
106106 --no-root Skip pruning root node_modules in workspace mode
107+ --experimental-default-files Enable experimental extended file list for more aggressive pruning
107108 -h, --help Show help
108109
109110Examples:
@@ -116,6 +117,10 @@ Workspace Examples:
116117 prune-mod --workspace # Auto-detect and prune all packages
117118 prune-mod -w --no-root # Prune only package node_modules
118119 prune-mod -w --workspace-root /monorepo # Specify workspace root
120+
121+ Experimental Examples:
122+ prune-mod --experimental-default-files # Use extended file list
123+ prune-mod -w --experimental-default-files # Combine with workspace mode
119124```
120125
121126### Real-world examples
@@ -193,6 +198,30 @@ prune-mod safely removes these types of files:
193198- Binary executables
194199- Critical system files
195200
201+ ### Experimental Extended File List
202+
203+ For even more aggressive space savings, prune-mod offers an experimental mode that removes additional safe files:
204+
205+ ``` bash
206+ # Enable experimental extended file list
207+ prune-mod --experimental-default-files
208+
209+ # Use with other options
210+ prune-mod --experimental-default-files --workspace --verbose
211+ ```
212+
213+ ** Experimental mode adds 140+ additional file patterns** including:
214+ - Extended documentation files (CHANGELOG.md, CODE_OF_CONDUCT.md, SECURITY.md)
215+ - Advanced configuration files (webpack.config.* , rollup.config.* , vite.config.* )
216+ - Git and version control files (.gitignore, .gitkeep, .dockerignore)
217+ - CI/CD configurations (azure-pipelines.yml, .drone.yml, buildkite.yml)
218+ - Code quality tools (.codeclimate.yml, codecov.yml, sonar-project.properties)
219+ - Build outputs and caches (dist/, build/, .cache/, .next/, .nuxt/)
220+ - Source maps and minified files (* .map, * .min.js, * .min.css)
221+ - Environment and runtime files (.env.example, .nvmrc, .python-version)
222+
223+ ** Safety note:** Experimental mode is thoroughly tested but more aggressive. Always test with ` --dry-run ` first to ensure it meets your needs.
224+
196225## Programming API
197226
198227Use prune-mod in your Node.js applications:
@@ -205,7 +234,10 @@ const pruner = new Pruner({
205234 verbose: true ,
206235 dryRun: false ,
207236 exceptions: [' *.config.*' ], // Files to keep
208- globs: [' **/*.tmp' ] // Files to remove
237+ globs: [' **/*.tmp' ], // Files to remove
238+ experimental: {
239+ defaultFiles: true // Enable extended file list
240+ }
209241});
210242
211243const stats = await pruner .prune ();
@@ -254,6 +286,11 @@ interface PrunerOptions {
254286 workspace? : boolean ; // Enable workspace mode (default: false)
255287 workspaceRoot? : string ; // Custom workspace root (auto-detected if not set)
256288 includeRoot? : boolean ; // Include root node_modules (default: true)
289+
290+ // Experimental options
291+ experimental? : {
292+ defaultFiles? : boolean ; // Enable extended file list (default: false)
293+ };
257294}
258295```
259296
0 commit comments