SkillAgentSearch skills...

Npmprune

Prune unnecessary files from node_modules

Install / Use

/learn @xthezealot/Npmprune
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"><img src="https://i.imgur.com/joBUSud.jpg" width="256" height="192"></p>

npmprune

npmprune.sh is an lightweight script designed to clean up your node_modules directory by removing unnecessary files like Markdown, doc and config files.

It helps in reducing the overall size of node_modules, optimizing storage space, and speeding up deployments, especially in containerized environments.

By detecting NODE_ENV, it can perform a more aggressive cleanup, tailored for production builds such as in Docker containers.

  1. Install
  2. Usage
  3. Integration
  4. Compatibility

Install

wget -O /usr/local/bin/npmprune https://raw.githubusercontent.com/xthezealot/npmprune/master/npmprune.sh && chmod +x /usr/local/bin/npmprune

Usage

npmprune

Production mode

If the NODE_ENV environment variable is set to production, NPMprune performs a more extensive cleanup by also removing type definitions.

Additional Patterns

You can provide additional patterns by passing them as arguments:

npmprune "*.log" "*.bak"

Integration

In deployment scripts

# Basic usage:
wget -qO- https://raw.githubusercontent.com/xthezealot/npmprune/master/npmprune.sh | sh

# With additional patterns:
wget -qO- https://raw.githubusercontent.com/xthezealot/npmprune/master/npmprune.sh | sh -s -- "*.log" "*.bak"

In a Dockerfile

# Basic usage:
RUN wget -qO- https://raw.githubusercontent.com/xthezealot/npmprune/master/npmprune.sh | sh

# With additional patterns:
RUN wget -qO- https://raw.githubusercontent.com/xthezealot/npmprune/master/npmprune.sh | sh -s -- "*.log" "*.bak"

Compatibility

npmprune is compatible with both Linux and macOS environments, even with the most basic Alpine Linux setup.

View on GitHub
GitHub Stars180
CategoryDevelopment
Updated1mo ago
Forks8

Languages

Shell

Security Score

80/100

Audited on Mar 6, 2026

No findings