Configurable cleaning tool for JavaScript/TypeScript projects
npx cleanx
- Highly configurable - Custom profiles, patterns, and workspace-specific rules
- Works with single projects and monorepos
- Built-in cleaning profiles with sensible defaults
- Dry-run mode to preview changes
- Smart exclude patterns protect important files
pnpm add -D cleanx
default
- Cleans build outputs, keeps node_modules
dist/, build/, out/, coverage/, .cache/, .turbo/, .next/, etc.
full
- Includes node_modules/
cleanx --profile=full
Flexible configuration via cleanx.config.ts
:
import { defineConfig } from "cleanx";
export default defineConfig({
include: ["dist", ".turbo"],
exclude: [".env", "important-file.json"],
profiles: {
ci: {
include: ["coverage", ".cache"],
},
},
workspaces: {
"apps/*": {
exclude: ["public/uploads"],
},
},
});
USAGE cleanx [OPTIONS]
OPTIONS
--config Path to config file
--cwd Set working directory
--dryRun Show what would be deleted without actually deleting
--profile="default" Cleaning profile to use