// the find
tj/node-prune
Remove unnecessary files from node_modules (.md, .ts, ...)
node-prune is a Go CLI that strips development-only files from node_modules — readmes, TypeScript sources, test files, maps — before you ship a Node app somewhere size matters. It was built specifically to slim down serverless deployments where the whole directory gets zipped and uploaded. At 4k stars it clearly scratched a real itch circa 2017–2018.
Fast: written in Go and walks the tree concurrently, so 13 MB gone in 200ms is realistic. Dead simple interface — run it in a directory and it just works, no config file required. The scope is intentional and narrow, which means there's almost no surface area for it to break something. Integrating it as a postinstall script in package.json is a genuinely useful pattern for CI pipelines.
Abandoned since 2022 with no activity, and the problem it solves has largely been absorbed by better tools — npm pack's .npmignore, Yarn's nohoist, and especially bundlers like esbuild or ncc that tree-shake node_modules entirely rather than file-prune them. The filter list is hardcoded in prune.go with no way to customize what gets removed, so if you have a legitimate .md file your app actually reads at runtime, it's gone. gobinaries.com, the recommended install path in the README, shut down in 2023, so the installation instructions are broken out of the box.