# tj/node-prune

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tj-node-prune).**

4,429 stars · 132 forks · Go · MIT

## Links

- GitHub: https://github.com/tj/node-prune
- awesome-repositories: https://awesome-repositories.com/repository/tj-node-prune.md

## Description

node-prune is a utility for cleaning and shrinking Node.js dependency folders by removing source files and documentation not required for runtime execution. It functions as a package cleaner that deletes non-essential files, such as markdown and TypeScript files, from installed npm dependencies to reduce installation size.

The tool optimizes deployment artifacts and container images by stripping unnecessary files from third-party library directories. This process is used to minimize Docker image sizes and reduce the footprint of final application bundles.

The project provides a command-line interface to automate the pruning of dependency directories. It leverages recursive directory traversal and pattern-based filtering to identify and remove non-runtime files.

## Tags

### Software Engineering & Architecture

- [Vendor Directory Pruning](https://awesome-repositories.com/f/software-engineering-architecture/dependency-maintenance/vendored-code-maintenance/vendor-directory-pruning.md) — Provides a CLI utility to remove non-essential files and source code from dependency directories. ([source](https://github.com/tj/node-prune/tree/master/internal/prune))
- [Recursive Directory Traversers](https://awesome-repositories.com/f/software-engineering-architecture/recursive-validation-engines/recursive-tree-traversers/file-system-traversers/recursive-directory-traversers.md) — Recursively walks through the nested folder structure of node_modules to locate all files for evaluation.

### Development Tools & Productivity

- [Node.js Dependency Pruners](https://awesome-repositories.com/f/development-tools-productivity/node-js-dependency-pruners.md) — Functions as a tool to remove non-essential source files and documentation from node_modules to reduce size.
- [Runtime Footprint Optimizers](https://awesome-repositories.com/f/development-tools-productivity/node-js-deployment-tools/runtime-footprint-optimizers.md) — Shrinks the size of node_modules directories by removing files not required for runtime execution.
- [npm Package Cleaners](https://awesome-repositories.com/f/development-tools-productivity/npm-package-cleaners.md) — Deletes markdown and TypeScript files from installed npm dependencies to save disk space.

### DevOps & Infrastructure

- [Pattern-Based File Deletions](https://awesome-repositories.com/f/devops-infrastructure/label-based-selection/target-selection-rules/file-deletion-rules/pattern-based-file-deletions.md) — Identifies non-runtime files for deletion by matching names and extensions against predefined patterns.
- [Artifact Size Optimization](https://awesome-repositories.com/f/devops-infrastructure/ci-cd-pipeline-orchestration/artifact-size-optimization.md) — Speeds up deployment pipelines by pruning dependency directories before uploading artifacts.
- [Dependency Stripping](https://awesome-repositories.com/f/devops-infrastructure/container-orchestration/container-runtimes/runtime-configuration-interfaces/docker-socket-orchestrators/docker-target-configurators/docker-container-deployments/docker-image-building/language-base-images/minimal-base-images/minimal-base-image-creation/dependency-stripping.md) — Reduces the size of container images by stripping unnecessary documentation and source files from node_modules.
- [Deployment Bundle Reduction](https://awesome-repositories.com/f/devops-infrastructure/deployment-bundle-reduction.md) — Shrinks the final application bundle by removing non-essential files from third-party library directories.

### Programming Languages & Runtimes

- [Node Modules Optimizations](https://awesome-repositories.com/f/programming-languages-runtimes/node-modules-optimizations.md) — Removes non-runtime files from dependency folders to reduce disk space and installation size.

### Part of an Awesome List

- [前端自动化(Workflow)](https://awesome-repositories.com/f/awesome-lists/more/workflow.md) — Listed in the “前端自动化(Workflow)” section of the Awesome Frontend awesome list.
