Skip to content
KitploitKITPLOIT
HerramientasExploitsBlog
Log in
Enviar
HerramientasExploitsBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

FeedsContactoPrivacidad© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
rev-dep — Kit de herramientas de análisis y optimización de dependencias para bases de código modernas de JavaScript y TypeScript. Aplica higiene al grafo de dependencias y elimina código no utilizado con una CLI muy rápida. | Kitploit
Herramientas/GitHubGitHub/jayu/rev-dep
Análisis EstáticoAnálisis de CódigoDevSecOpsDetección de SecretosMala Configuración
GitHubjayu/rev-dep

rev-dep

Kit de herramientas de análisis y optimización de dependencias para bases de código modernas de JavaScript y TypeScript. Aplica higiene al grafo de dependencias y elimina código no utilizado con una CLI muy rápida.

Ver Repositorio
252648hace 13 díasRevisado por Kitploit

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Sitio web
Compartir
Contenido no disponible en el idioma solicitado. Mostrando versión en inglés.
# Rev-dep

<p align="center">
<img src="https://raw.githubusercontent.com/jayu/rev-dep/master/logo.png" width="490" alt="Rev-dep logo">
</p>

<p align="center">
  <a href="#capabilities-">Capabilities</a>&nbsp;&nbsp;•&nbsp;&nbsp;
  <a href="#installation-">Installation</a>&nbsp;&nbsp;•&nbsp;&nbsp;
  <a href="https://rev-dep.com/docs/intro"><b>Documentation</b></a>&nbsp;&nbsp;•&nbsp;&nbsp;
  <a href="#exploratory-toolkit-">Exploratory Toolkit</a>&nbsp;&nbsp;•&nbsp;&nbsp;
  <a href="https://rev-dep.com/newsletter">Newsletter</a>
</p>

<p align="center">
  Dependency analysis and optimization toolkit for modern JavaScript and TypeScript codebases.  
  <br>
  Enforce dependency graph hygiene and remove unused code with a very fast CLI.
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/jayu/rev-dep/master/demo.png" alt="Rev-dep config execution CLI output" width="490">
</p>

---

<img alt="rev-dep version" src="https://img.shields.io/npm/v/rev-dep"> <img alt="rev-dep license" src="https://img.shields.io/npm/l/rev-dep"> <img alt="rev-dep PRs welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square">

## **About 📣**

As codebases scale, maintaining a mental map of dependencies becomes impossible. **Rev-dep** is a high-speed static analysis tool designed to enforce architecture integrity and dependency hygiene across large-scale JS/TS projects.

<p align="center"><b>Think of Rev-dep as a high-speed linter for your dependency graph.</b></p>

**Consolidate fragmented, sequential checks from multiple slow tools into a single, high-performance engine.** Rev-dep executes a full suite of governance checks - including circularity, orphans, module boundaries and more, in one parallelized pass. Implemented in **Go** to bypass the performance bottlenecks of Node-based analysis, it can audit a **500k+ LoC project in approximately 150ms**. [See the performance comparison](#performance-comparison-)

### **Automated Codebase Governance**

Rev-dep moves beyond passive scanning to active enforcement, answering (and failing CI for) the hard questions:

* **Architecture Integrity:** "Is my 'Domain A' illegally importing from 'Domain B'?".
* **Dead Code & Bloat:** "Are these files unreachable, or are these `node_modules` unused?".
* **Refactoring Safety:** "Which entry points actually use this utility, and are there circular chains?".
* **Workspace Hygiene:** "Are my imports consistent and are all dependencies declared?".

Rev-dep serves as a **high-speed gatekeeper** for your CI, ensuring your dependency graph remains lean and your architecture stays intact as you iterate.

## **Why Rev-dep? 🤔**

### 🏗️ **First-class monorepo support**
Designed for modern workspaces (`pnpm`, `yarn`, `npm`). Rev-dep natively resolves `package.json` **exports/imports** maps, TypeScript aliases and traces dependencies across package boundaries.

### 🛡️ **Config-Based Codebase Governance**
Move beyond passive scanning. Use the configuration engine to enforce **Module Boundaries** and **Import Conventions**. Execute a full suite of hygiene checks (circularity, orphans, unused modules and more) in a **single, parallelized pass** that serves as a high-speed gatekeeper for your CI.

Adopt checks with existing issues using a [findings baseline](https://rev-dep.com/docs/config-based-checks/findings-baseline): acknowledge the current issue set, keep CI passing, and detect new or obsolete findings while fixing the backlog gradually.

### 🔍 **Exploratory Toolkit**
CLI toolkit that helps debug issues with dependencies between files. Understand transitive relation between files and fix issues.

### ⚡ **Built for Speed and CI Efficiency**
Implemented in **Go** to eliminate the performance tax of Node-based analysis. By processing files in parallel, Rev-dep offers **17x-90x faster execution** than alternatives, significantly **reducing CI costs** and developer wait-states.

> **Rev-dep can audit a 500k+ LoC project in around 150ms.**
> [See the performance comparison](#performance-comparison-)

## Capabilities 🚀

### Governance and maintenance (config-based) 🛡️

Use `rev-dep config run` to execute multiple checks in one pass for all packages.

Available checks:

- `moduleBoundaries` - enforce architecture boundaries between modules.
- `importConventions` - enforce import style conventions (offers autofix).
- `unusedExportsDetection` - detect exports that are never used (offers autofix).
- `orphanFilesDetection` - detect dead/orphan files (offers autofix).
- `unusedNodeModulesDetection` - detect dependencies declared but not used.
- `missingNodeModulesDetection` - detect imports missing from package json.
- `unresolvedImportsDetection` - detect unresolved import requests.
- `circularImportsDetection` - detect circular imports.
- `duplicatedCodeDetection` - detect copy-pasted code (repeated blocks and JSX elements).
- `devDepsUsageOnProdDetection` - detect dev dependencies used in production code.
- `restrictedImportsDetection` - block importing denied files/modules from selected entry points.
- `restrictedImportersDetection` - whitelist which entry points may transitively reach a set of files/modules.
- `restrictedDirectImportersDetection` - constrain which files may directly import a set of files/modules (non-transitive).

### Exploratory analysis (CLI-based) 🔍

Use CLI commands for ad-hoc dependency exploration:

- `entry-points` - discover project entry points.
- `files` - list dependency tree files for a given entry point.
- `resolve` - trace dependency paths between files (who imports this file).
- `imported-by` - list direct importers of a file.
- `circular` - list circular dependency chains.
- `duplicated-code` - find copy-pasted code blocks and JSX elements.
- `node-modules` - inspect `used`, `unused`, `missing`, and `installed` node modules.
- `lines-of-code` - count effective LOC.
- `unresolved` - list imports that could not be resolved, grouped by file.
- `list-cwd-files` - list all source code files in CWD
- `debug` - inspect what rev-dep parses, resolves, and discovers internally.

## **Installation 📦**

Full documentation: [rev-dep.com/docs/intro](https://rev-dep.com/docs/intro)

**Install locally to set up project check scripts**

```
yarn add -D rev-dep
```

```
npm install -D rev-dep
```

```
pnpm add -D rev-dep
```

Create config file for a quick start:

```
npx rev-dep config init
```

**Install globally to use as a CLI tool:**

```
yarn global add rev-dep
```

```
npm install -g rev-dep
```

```
pnpm global add rev-dep
```

### Step-by-step integration guides

Follow the guide that matches your project to get from zero to a working setup:

- [Monorepo integration guide](https://rev-dep.com/docs/monorepo-integration-guide) - for `pnpm`/`yarn`/`npm` workspaces.
- [Single workspace integration guide](https://rev-dep.com/docs/single-workspace-integration-guide) - for single-package projects.

## **Quick Examples 💡**

A few instant-use examples to get a feel for the tool:

```bash

# Detect circular imports/dependencies
rev-dep circular

# Find copy-pasted code
rev-dep duplicated-code

# Detect unused node modules
rev-dep node-modules unused

# List all entry points in the project
rev-dep entry-points

# Check which files an entry point imports
rev-dep files --entry-point src/index.ts

# Find every entry point that depends on a file
rev-dep resolve --file src/utils/math.ts

# Resolve dependency path between files
rev-dep resolve --file src/utils/math.ts --entry-point src/index.ts

```

## Config-Based Checks 🛡️

Rev-dep provides a configuration system for orchestrating project checks. The config approach is **designed for speed** and is the **preferred way** of implementing project checks because it can execute all checks in a single pass, significantly faster than multiple running individual commands separately.

Available checks are:

- `moduleBoundaries` - enforce architecture boundaries between modules.
- `importConventions` - enforce import style conventions (offers autofix).
- `unusedExportsDetection` - detect exports that are never used (offers autofix).
- `orphanFilesDetection` - detect dead/orphan files (offers autofix).
- `unusedNodeModulesDetection` - detect dependencies declared but not used.
- `missingNodeModulesDetection` - detect imports missing from package json.
- `unresolvedImportsDetection` - detect unresolved import requests.
- `circularImportsDetection` - detect circular imports.
- `duplicatedCodeDetection` - detect copy-pasted code blocks and JSX elements.
- `devDepsUsageOnProdDetection` - detect dev dependencies used in production code.
- `restrictedImportsDetection` - block importing denied files/modules from selected entry points.
- `restrictedImportersDetection` - whitelist which entry points may transitively reach a set of files/modules.
- `restrictedDirectImportersDetection` - constrain which files may directly import a set of files/modules (non-transitive).

Checks are grouped in workspaces. You can have multiple workspaces, eg. for each monorepo package.

### Getting Started

Initialize a configuration file in your project:

```bash
# Create a default configuration file
rev-dep config init
```

Behavior of `rev-dep config init`:

- Monorepo root: Running `rev-dep config init` at the workspace root creates a root workspace and a workspace for each discovered workspace package.
- Monorepo workspace package or regular projects: Running `rev-dep config init` inside a directory creates config with a single workspace with `path: "."` for this directory.

Run all configured checks (dry run, not fixes applied yet):

```bash
# Execute all workspaces and checks defined in the config
rev-dep config run
```

List all detected issues:
```bash
# Lists all detected issues, by default lists first five issues for each check
rev-dep config run --list-all-issues
```

Fix all fixable checks: 

```bash
# Fix checks configured with autofix
rev-dep config run --fix
```

### Acknowledge Existing Findings

After verifying resolution and entry points, add `"baselineSnapshotPath": ".rev-dep.baseline.json"` at the top level of your config, alongside `workspaces`. The path is relative to the config directory. Record all configured workspaces and checks:

```bash
rev-dep config run --update-snapshot
```

Review and commit the config and baseline. CI keeps running `rev-dep config run`: acknowledged findings pass, and new or obsolete findings fail. Line-number changes do not cause differences. After an intentional change, update the baseline locally and commit it.

Duplicated code has its own specialized snapshots and is excluded from the general baseline. The same update flag rewrites both when configured. See the [findings baseline guide](https://rev-dep.com/docs/config-based-checks/findings-baseline) for setup and comparison rules.

### Configuration Structure

The configuration file (`rev-dep.config.json(c)` or `.rev-dep.config.json(c)`) allows you to define multiple workspaces, each targeting different parts of your codebase with specific checks enabled.

#### Quick Start Configuration

```jsonc
{
  "configVersion": "2.2",
  "$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/2.2.schema.json?raw=true",
  "nodeModulesResolution": { "resolutionType": "entry-package", "includeDevDepsFromRoot": false },
  "workspaces": [
    {
      "path": ".",
      "prodEntryPoints": ["src/main.tsx", "src/pages/**/*.tsx"],
      "devEntryPoints": ["scripts/**", "**/*.test.*"],
      "unusedExportsDetection": {
        "enabled": true,
        "autofix": true
      },
      "orphanFilesDetection": {
        "enabled": true,
        "autofix": true
      },
      "unusedNodeModulesDetection": { 
        "enabled": true 
      },
      "circularImportsDetection": { 
        "enabled": true 
      },
      "devDepsUsageOnProdDetection": {
        "enabled": true,
        "ignoreTypeImports": true
      }
    }
  ]
}
```

#### Comprehensive Config Example

Here's a comprehensive example showing all available properties:

```jsonc
{
  "configVersion": "2.2",
  "$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/2.2.schema.json?raw=true", // enables json autocompletion
  "baselineSnapshotPath": ".rev-dep.baseline.json", // optional; create it with config run --update-snapshot before running checks
  "conditionNames": ["import", "default"],
  "ignoreFiles": ["**/*.test.*"],
  "nodeModulesResolution": { "resolutionType": "entry-package", "includeDevDepsFromRoot": false },
  "failOnEmptyWorkspace": true,
  "workspaces": [
    {
      "path": ".",
      "followMonorepoPackages": true,
      "prodEntryPoints": ["src/main.tsx", "src/pages/**/*.tsx", "src/server.ts"],
      "devEntryPoints": ["scripts/**", "**/*.test.*"],
      "ignoreEntryPoints": ["src/legacy/oldDashboard.tsx"],
      "moduleBoundaries": [
        {
          "name": "ui-components",
          "pattern": "src/components/**/*",
          "allow": ["src/utils/**/*", "src/types/**/*"],
          "deny": ["src/api/**/*"]
        },
        {
          "name": "api-layer",
          "pattern": "src/api/**/*",
          "allow": ["src/utils/**/*", "src/types/**/*"],
          "deny": ["src/components/**/*"]
        }
      ],
      "importConventions": [
        {
          "rule": "relative-internal-absolute-external",
          "autofix": true,
          "domains": [
            {
              "path": "src/features/auth",
              "alias": "@auth",
              "enabled": true
            },
            {
              "path": "src/shared/ui",
              "alias": "@ui-kit",
              "enabled": false // checks disabled for this domain, but alias is still used for absolute imports from other domains
            }
          ]
        }
      ],
      "circularImportsDetection": {
        "enabled": true,
        "ignoreTypeImports": true
      },
      "orphanFilesDetection": {
        "enabled": true,
        "ignoreTypeImports": true,
        "graphExclude": ["**/*.test.*", "**/stories/**/*"],
        "autofix": true
      },
      "unusedNodeModulesDetection": {
        "enabled": true,
        "includeModules": ["@myorg/**"],
        "excludeModules": ["@types/**"],
        "pkgJsonFieldsWithBinaries": ["scripts", "bin"],
        "filesWithBinaries": ["scripts/check-something.sh"],
        "filesWithModules": [".storybook/main.ts"],
        "outputType": "groupByModule"
      },
      "missingNodeModulesDetection": {
        "enabled": true,
        "includeModules": ["lodash", "axios"],
        "excludeModules": ["@types/**"],
        "outputType": "groupByFile"
      },
      "unusedExportsDetection": {
        "enabled": true,
        "autofix": true,
        "ignoreTypeExports": true,
        "graphExclude": ["**/*.stories.tsx"],
        "ignore": {
          "src/types.ts": "B*",
          "**/generated/**/*.ts": "*"
        },
        "ignoreFiles": ["**/*.generated.ts"],
        "ignoreExports": ["default", "unused*"],
      },
      "unresolvedImportsDetection": {
        "enabled": true,
        "ignore": {
          "src/index.ts": "legacy-*"
        },
        "ignoreFiles": ["**/*.generated.ts"],
        "ignoreImports": ["@internal/*"],
        "reportNonLiteralImports": true
      },
      "devDepsUsageOnProdDetection": {
        "enabled": true,
        "ignoreTypeImports": true
      },
      "restrictedImportsDetection": {
        "enabled": true,
        "entryPoints": ["src/server.ts", "src/server/**/*.ts"],
        "graphExclude": ["some-file-coupling-other-files.ts"],
        "denyFiles": ["**/*.tsx"],
        "denyModules": ["react", "react-*"],
        "ignoreMatches": ["src/server/allowed-view.tsx", "react-awsome-lib"],
        "ignoreTypeImports": true
      }
    }
  ]
}
```

### Available Properties

#### Root Level Properties

- **`configVersion`** (required): Configuration version string
- **`baselineSnapshotPath`** (optional): Path to a committed findings baseline, relative to the config directory. Record it with `rev-dep config run --update-snapshot`; ordinary runs fail on new or obsolete findings. Excludes duplicated code, which uses its own `snapshotPath`. See the [guide](https://rev-dep.com/docs/config-based-checks/findings-baseline).
- **`$schema`** (optional): JSON schema reference for validation
- **`conditionNames`** (optional): Array of condition names for exports resolution
- **`customAssetExtensions`** (optional): Additional asset extensions treated as resolvable imports (e.g. `["glb", "mp3"]`). Default list covers common extensions for fonts, images, config files.
- **`ignoreFiles`** (optional): Global file patterns to ignore across all workspaces. Git ignored files are skipped by default.
- **`processIgnoredFiles`** (optional): Global file patterns to process even if they match gitignore or `ignoreFiles`.
- **`nodeModulesResolution`** (optional): Which `package.json` each third-party import is validated against for the `missingNodeModules`, `unusedNodeModules`, and `unresolvedImports` checks. Configure it as an object `{ "resolutionType": ..., "includeDevDepsFromRoot": ... }` - the form `rev-dep config init` generates. `resolutionType` is `"entry-package"` (default, validates against the workspace's entry `package.json`) or `"nearest-package"` (validates against the `package.json` owning each file - use for pnpm's default layout, where each package resolves only its own dependencies). `includeDevDepsFromRoot` (default `false`) lets package code use dev dependencies declared only at the monorepo root without `missingNodeModules` or `unresolvedImports` flagging them. A bare string (e.g. `"nearest-package"`) is also accepted as a backward-compatible shorthand for `resolutionType`. Applies to all workspaces. See the [docs](https://rev-dep.com/docs/other-concepts-and-features/node-modules-resolution).
- **`workspaces`** (required): Array of workspace objects

#### Workspace Properties
Each workspace can contain the following properties:

- **`path`** (required): Target directory path for this workspace (either `.` or path starting with sub directory name)
- **`followMonorepoPackages`** (optional): Control monorepo package resolution. `true` follows all workspace packages (default), `false` disables it, array follows only selected package names.
- **`prodEntryPoints`** (optional): Workspace-level production entry point patterns for detector defaults
- **`devEntryPoints`** (optional): Workspace-level development entry point patterns for detector defaults
- **`ignoreEntryPoints`** (optional): Workspace-level patterns for leftover entry points you no longer care about. Files matching these patterns are not processed as issues - they are never reported as orphan files, and their unused exports are not reported. Useful for files that must stay committed but are no longer wired into the app.
- **`moduleBoundaries`** (optional): Array of module boundary rules
- **`circularImportsDetection`** (optional): Circular import detection configuration (single object or array of objects)
- **`duplicatedCodeDetection`** (optional): Duplicated code detection configuration (single object or array of objects)
- **`orphanFilesDetection`** (optional): Orphan files detection configuration (single object or array of objects)  
- **`unusedNodeModulesDetection`** (optional): Unused node modules detection configuration (single object or array of objects)
- **`missingNodeModulesDetection`** (optional): Missing node modules detection configuration (single object or array of objects)
- **`unusedExportsDetection`** (optional): Unused exports detection configuration (single object or array of objects)
- **`unresolvedImportsDetection`** (optional): Unresolved imports detection configuration (single object or array of objects)
- **`devDepsUsageOnProdDetection`** (optional): Restricted dev dependencies usage detection configuration (single object or array of objects)
- **`restrictedImportsDetection`** (optional): Restrict importing denied files/modules from selected entry points (single object or array of objects)
- **`restrictedImportersDetection`** (optional): Whitelist which entry points may transitively reach a set of files/modules (single object or array of objects)
- **`restrictedDirectImportersDetection`** (optional): Constrain which files may directly import a set of files/modules; non-transitive (single object or array of objects)
- **`importConventions`** (optional): Array of import convention rules

#### Module Boundary Properties
- **`name`** (required): Name of the boundary
- **`pattern`** (required): Glob pattern for files in this boundary
- **`allow`** (optional): Array of allowed import patterns
- **`deny`** (optional): Array of denied import patterns (overrides allow)

#### Import Convention Properties
- **`rule`** (required): Type of the rule, currently only `relative-internal-absolute-external`
- **`autofix`** (optional): Whether to automatically fix import convention violations (default: false)
- **`domains`** (required): Array of domain definitions. Can be a string (glob pattern) or an object with:
  - **`path`** (required): Directory with the domain files
  - **`alias`** (optional): Alias to be used for absolute imports of code from this domain
  - **`enabled`** (optional): Set to `false` to skip checks for this domain (default: true)

#### Detection Options Properties

Each detection property can be configured as:
- a single object (one detector instance), or
- an array of objects (multiple detector instances evaluated within the same workspace).

**CircularImportsDetection:**
- **`enabled`** (required): Enable/disable circular import detection
- **`ignoreTypeImports`** (optional): Exclude type-only imports when building graph (default: false)

**DuplicatedCodeDetection:**
- **`enabled`** (required): Enable/disable duplicated code detection
- **`blindIdentifiers`** (optional): Treat names as wildcards, so a renamed copy still counts (default: false)
- **`blindStrings`** (optional): Treat string and template contents as wildcards (default: false)
- **`blindNumbers`** (optional): Treat numeric literals as wildcards (default: false)
- **`minTokens`** (optional): Smallest duplication to report, in tokens (default: 50)
- **`minLines`** (optional): Smallest duplication to report, in lines (default: 3)
- **`minDepth`** (optional): Smallest nesting depth, counting the block itself. 2 requires at least one nested level (default: 0)
- **`minStatements`** (optional): Smallest statement count; applies only to statement blocks (default: 0)
- **`minDuplicates`** (optional): How many copies a chunk needs before it is reported (default: 2)
- **`skipObjects`** (optional): Do not report duplications that are only object literals (default: false)
- **`ignoreFiles`** (optional): Glob patterns to leave out of the analysis
- **`snapshotPath`** (optional): Path to a committed baseline of acknowledged duplications, relative to the workspace. With it the check reports what changed rather than the total

**OrphanFilesDetection:**
- **`enabled`** (required): Enable/disable orphan files detection
- **`validEntryPoints`** (optional): Array of valid entry point patterns. If omitted, defaults to `prodEntryPoints + devEntryPoints` from workspace level.
- **`ignoreTypeImports`** (optional): Exclude type-only imports when building graph (default: false)
- **`graphExclude`** (optional): File patterns to exclude from graph analysis
- **`autofix`** (optional): Delete detected orphan files automatically when running `rev-dep config run --fix` (default: false)

**UnusedNodeModulesDetection:**
- **`enabled`** (required): Enable/disable unused modules detection
- **`includeModules`** (optional): Module patterns to include in analysis
- **`excludeModules`** (optional): Module patterns to exclude from analysis
- **`pkgJsonFieldsWithBinaries`** (optional): Package.json fields containing binary references (eg. lint-staged). Performs plain-text lookup
- **`filesWithBinaries`** (optional): File patterns to search for binary usage. Performs plain-text lookup
- **`filesWithModules`** (optional): Non JS/TS file patterns to search for module imports (eg. shell scripts). Performs plain-text lookup
- **`outputType`** (optional): Output format - "list", "groupByModule", "groupByFile"

**MissingNodeModulesDetection:**
- **`enabled`** (required): Enable/disable missing modules detection
- **`includeModules`** (optional): Module patterns to include in analysis
- **`excludeModules`** (optional): Module patterns to exclude from analysis
- **`outputType`** (optional): Output format - "list", "groupByModule", "groupByFile", "groupByModuleFilesCount"

**UnusedExportsDetection:**
- **`enabled`** (required): Enable/disable unused exports detection
- **`validEntryPoints`** (optional): Glob patterns for files whose exports are never reported as unused. If omitted, defaults to `prodEntryPoints + devEntryPoints` from workspace level.
- **`ignoreTypeExports`** (optional): Skip `export type` / `export interface` from analysis (default: false)
- **`graphExclude`** (optional): File patterns to exclude from unused exports analysis
- **`ignore`** (optional): Map of file path globs (relative to workspace path directory) to export name/specifier glob(s) to suppress; each value can be a string or array of strings
- **`ignoreFiles`** (optional): File path globs; all unused exports from matching files are suppressed
- **`ignoreExports`** (optional): Export names/specifiers (or globs) to suppress globally (supports `"default"`)
- **`autofix`** (optional): Automatically apply fixable unused exports changes when running `rev-dep config run --fix` (default: false)

**UnresolvedImportsDetection:**
- **`enabled`** (required): Enable/disable unresolved imports detection
- **`ignore`** (optional): Map of file path globs (relative to workspace path directory) to import request glob(s) to suppress; each value can be a string or array of strings
- **`ignoreFiles`** (optional): File path globs; all unresolved imports from matching files are suppressed
- **`ignoreImports`** (optional): Import requests (or globs) to suppress globally in unresolved results

**DevDepsUsageOnProdDetection:**
- **`enabled`** (required): Enable/disable restricted dev dependencies usage detection
- **`prodEntryPoints`** (optional): Production entry point patterns to trace dependencies from. If omitted, defaults to workspace-level `prodEntryPoints`.
- **`ignoreTypeImports`** (optional): Exclude type-only imports from graph traversal and module matching (default: false)

**RestrictedImportsDetection:**
- **`enabled`** (required): Enable/disable restricted imports detection
- **`entryPoints`** (required when enabled): Entry point patterns used to build reachable dependency graph (workspace-level entry points are not applied here)
- **`graphExclude`** (optional): File patterns to exclude from restricted imports graph analysis
- **`denyFiles`** (optional): Denied file path patterns (eg. ["**/*.tsx"])
- **`denyModules`** (optional): Denied module patterns (eg. ["react", "react-*"])
- **`ignoreMatches`** (optional): File/module patterns to suppress from restricted import results
- **`ignoreTypeImports`** (optional): Exclude type-only imports from traversal (default: false)

### Performance Benefits

The configuration approach provides significant performance advantages:

- **Single Dependency Tree Build**: Builds one comprehensive dependency tree for all workspaces
- **Parallel Workspace Execution**: Processes multiple workspaces simultaneously
- **Parallel Check Execution**: Runs all enabled checks within each workspace in parallel
- **Optimized File Discovery**: Discovers files once and reuses across all checks

This makes config-based checks faster than running individual commands sequentially, especially for large codebases with multiple sub packages.

## **Exploratory Toolkit 🔧**

Practical examples show how to use rev-dep CLI commands to explore, debug or build code quality checks for your project.

### **How to identify where a file is used in the project**

```
rev-dep resolve --file path/to/file.ts
```

You’ll see all entry points that implicitly require that file, along with resolution paths.

### **How to check if a file is used**

```
rev-dep resolve --file path/to/file.ts --compact-summary
```

Shows how many entry points indirectly depend on the file.

### **How to identify dead files**

```
rev-dep entry-points
```

Exclude framework entry points if needed using `--result-exclude`.

For example exclude Next.js valid entry points when using pages router, exclude scripts directory - scripts are valid entry-points and exclude all test files:

```
rev-dep entry-points --result-exclude "pages/**","scripts/**","**/*.test.*"
```

### **How to list all files imported by an entry point**

```
rev-dep files --entry-point path/to/file.ts
```

Useful for identifying heavy components or unintended dependencies.

### **How to reduce unnecessary imports for an entry point**

1. List all files imported:

   ```
   rev-dep files --entry-point path/to/entry.ts
   ```
2. Identify suspicious files.
3. Trace why they are included:

   ```
   rev-dep resolve --file path/to/suspect --entry-points path/to/entry.ts --all
   ```

### **How to detect circular dependencies**

```
rev-dep circular
```

### **How to detect duplicated code**

```
rev-dep duplicated-code
```

Reports repeated code blocks and JSX elements - units you can extract - rather than repeated lines. Add `--blind-identifiers` to catch copies whose variables were renamed.

### **How to find unused node modules**

```
rev-dep node-modules unused
```

### **How to find missing node modules**

```
rev-dep node-modules missing
```

### **How to check node_modules space usage**

```
rev-dep node-modules dirs-size
```

### **How to detect dev dependencies used in production code**

```
rev-dep config run
```

When `devDepsUsageOnProdDetection` is enabled in your config, rev-dep will:

1. Trace dependency graphs from your specified production entry points
2. Identify all files reachable from those entry points
3. Check if any imported modules are listed in `devDependencies` in package.json
4. Report violations showing which dev dependencies are used where

**Example Output:**
```
❌ Restricted Dev Dependencies Usage Issues (2):
  lodash (dev dependency)
     - src/components/Button.tsx (from entry point: src/pages/index.tsx)
     - src/utils/helpers.ts (from entry point: src/pages/index.tsx)
  eslint (dev dependency)
     - src/config/eslint-config.js (from entry point: src/server.ts)
```

**Important Notes:**
- Type-only imports (e.g., `import type { ReactNode } from 'react'`) are ignored when `ignoreTypeImports` is enabled
- Only dependencies from `devDependencies` in package.json are flagged
- Production dependencies from `dependencies` are allowed
- Helps prevent runtime failures in production builds

## Working with Monorepo 🏗️

Rev-dep provides first-class support for monorepo projects, enabling accurate dependency analysis across workspace packages.

### followMonorepoPackages Flag

The `--follow-monorepo-packages` flag enables resolution of imports from monorepo workspace packages. By default, this flag is set to `false` to maintain compatibility with single-package projects.

```bash
# Enable monorepo package resolution
rev-dep circular --follow-monorepo-packages
rev-dep resolve --file src/utils.ts --follow-monorepo-packages
rev-dep entry-points --follow-monorepo-packages
```

When enabled, rev-dep will:

- **Detect workspace packages** automatically by scanning for monorepo configuration
- **Resolve imports between packages** within the workspace
- **Follow package.json exports** for proper module resolution

### Exports Map Support

Rev-dep fully supports the `exports` field in package.json files, which is the standard way to define package entry points in modern Node.js projects.

The exports map support includes:

- **Conditional exports** using conditions like `node`, `import`, `default`, and custom conditions
- **Wildcard patterns** for flexible subpath mapping
- **Sugar syntax** for simple main export definitions
- **Nested conditions** for complex resolution scenarios

### Condition Names Flag

To control which conditional exports are resolved, use the `--condition-names` flag. This allows you to specify the priority of conditions when resolving package exports:

```bash
# Resolve exports for different environments
rev-dep circular --condition-names=node,import,default
rev-dep resolve --file src/utils.ts --condition-names=import,node
```

---

[Read more](https://github.com/jayu/rev-dep)
Descargar herramienta