rev-dep 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/Readme.md +251 -98
  2. package/package.json +25 -23
package/Readme.md CHANGED
@@ -1,168 +1,242 @@
1
1
  <p align="center">
2
2
  <img src="https://github.com/jayu/rev-dep/raw/master/logo.png" width="400">
3
3
  </p>
4
+
4
5
  <p align="center">
5
- <a href="#about-">About</a>&nbsp;&nbsp;•&nbsp;&nbsp;
6
- <a href="#getting-started-">Getting Started</a>&nbsp;&nbsp;•&nbsp;&nbsp;
7
- <a href="#recipes-️">Recipes</a>&nbsp;&nbsp;•&nbsp;&nbsp;
8
- <a href="#cli-reference-">CLI Reference</a>
6
+ <a href="#key-features-">Key Features</a>&nbsp;&nbsp;•&nbsp;&nbsp;
7
+ <a href="#installation-">Installation</a>&nbsp;&nbsp;•&nbsp;&nbsp;
8
+ <a href="#quick-examples-">Quick Examples</a>&nbsp;&nbsp;•&nbsp;&nbsp;
9
+ <a href="#practical-examples-">Practical Examples</a>&nbsp;&nbsp;•&nbsp;&nbsp;
10
+ <a href="#cli-reference-">CLI Reference</a>
9
11
  </p>
10
12
 
11
13
  <p align="center">
12
- Dependency analysis and optimization toolkit for modern TypeScript projects.
14
+ Dependency analysis and optimization toolkit for modern JavaScript and TypeScript projects.
13
15
  <br>
14
- <a href="#reimplemented-to-achieve-7x-37x-speedup">Completely rewritten in Go for maximum speed and efficiency ⚡</a>
16
+ Trace imports, find unused code, clean dependencies all from a blazing-fast CLI.
15
17
  </p>
16
18
 
17
19
  ---
18
20
 
19
- <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">
21
+ <img alt="rev-dep version" src="https://img.shields.io/npm/v/rev-dep">
22
+ <img alt="rev-dep license" src="https://img.shields.io/npm/l/rev-dep">
23
+ <img alt="rev-dep PRs welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square">
24
+
25
+ ---
26
+
27
+ # **About 📣**
28
+
29
+ Working in large JS/TS projects makes it difficult to answer simple but crucial questions:
20
30
 
31
+ * Which files depend on this file?
32
+ * Is this file even used?
33
+ * Which files does this entry point import?
34
+ * Do I have circular dependencies?
35
+ * Which packages in node_modules are unused?
36
+ * Which modules take the most disk space?
21
37
 
22
- ## About 📣
38
+ rev-dep helps you understand the real structure of your codebase so you can debug issues faster, refactor safely, and keep your dependencies clean.
23
39
 
24
- The tool was created to help with daily development struggles by answering these questions:
40
+ It's particularly useful for JavaScript projects without TypeScript or test coverage — places where answering question "What will break if I change this" is not straightforward
25
41
 
26
- 👉 What entry points does my codebase have?
42
+ ---
27
43
 
28
- 👉 Which entry points use a given file?
44
+ ## **Why rev-dep? 🤔**
29
45
 
30
- 👉 Which dependencies does a given file have?
46
+ rev-dep is designed for **fast iteration** and **minimal, actionable results** — no noise, just answers.
31
47
 
32
- 👉 Do any circular dependencies exist in the project?
48
+ ### **Results in milliseconds**
33
49
 
34
- 👉 Which node modules are unused or not listed in package.json?
50
+ Built in Go for speed. Even on large codebases, rev-dep responds almost instantly.
35
51
 
36
- 👉 Which node modules take up the most space on disk?
52
+ ### **Actionable, list-based output**
37
53
 
54
+ You get **exact file paths**, **import chains**, and **clear dependency relationships** — the kind of information you can fix or clean up right away.
38
55
 
39
- This helps to debug project dependencies, plan refactoring, optimize bundles or plan code splitting.
56
+ ### **Designed for real-world JS/TS**
40
57
 
41
- It's especially useful in JS world without TypeScript or tests coverage.
58
+ Works with mixed JS/TS projects, path aliases and thousands of files without configuration hassles.
42
59
 
43
- It also helps to identify and eliminate dead files, understand the complexity of the file dependencies
60
+ ### **Deep analysis, one CLI**
44
61
 
45
- [🦘 Jump to CLI reference](#cli-reference-)
62
+ Unused files, unused or missing dependencies, reverse-imports, entry point detection, node_modules insights, dependency paths — everything in one tool.
46
63
 
47
- ### Use cases 🧑‍💻
64
+ <!--
65
+ ### ✔ **Much faster than alternatives**
48
66
 
49
- - [You plan to refactor some file and you wonder which entry points are affected](#how-to-identify-where-a-file-is-used-in-the-project)
50
- - [You are wondering wether a given source file is used](#how-to-check-if-a-file-is-used-in-the-project)
51
- - [You wonder if there are any dead files in your project](#how-to-identify-dead-files-in-the-project)
52
- - [You want to verify if a given entry point imports only the required files](#how-to-check-which-files-are-imported-by-a-given-file)
53
- - [You want to optimize the amount of files imported by an entry point](#how-to-reduce-amount-of-files-imported-by-entry-point)
54
- - [You want to detect circular dependencies in your project](#how-to-detect-circular-dependencies-in-the-project)
55
- - [You want to find unused node modules to clean up dependencies](#how-to-find-unused-node-modules)
56
- - [You want to identify which node modules are consuming the most disk space](#how-to-identify-space-consuming-node-modules)
67
+ rev-dep outperforms Madge, dpdm, dependency-cruiser, skott, knip, depcheck and other similar tools.
57
68
 
58
- ### How about dependency or bundle graphs?
69
+ For 500k+ lines of code and 6k+ source code files get checks as fast as:
59
70
 
60
- There are tool that can output nice, visual representation of project dependencies like [webpack-bundle-analyzer](https://www.npmjs.com/package/webpack-bundle-analyzer) or [dependency-cruiser](https://www.npmjs.com/package/dependency-cruiser) (_which btw rev-dep uses for non-TS codebases_)
71
+ | Task | Execution Time |
72
+ |------|----------------|
73
+ | Find circular dependencies | |
74
+ | Find unused files | |
75
+ | Find unused node modules | |
76
+ | Find missing node modules | |
77
+ | Trace reverse dependencies for a file | |
78
+ | Trace full dependency paths | |
79
+ | List all files imported by an entry point | |
80
+ | Discover entry points | |
81
+ | Count lines of code | |
82
+ | Check node_modules disk usage | |
83
+ | Analyze node_modules directory sizes | |
84
+ | List file-to-file dependency graph | |
61
85
 
62
- While graphs can be useful to identify major problems like too big bundle size or to visualize mess in your deps, it's hard to take any action based on them (_at least it was hard for me_ 🤷‍♂️)
86
+ >Benchmark run on WSL Linux Debian Intel(R) Core(TM) i9-14900KF CPU @ 2.80GHz
63
87
 
64
- `rev-dep` visualize dependencies as lists, so it's really easy to see where to cut the line to solve the problem.
88
+ --->
65
89
 
66
- ## Getting Started 🎉
90
+ If your project feels like a dependency maze, rev-dep gives you a map.
67
91
 
68
- ### Install globally to use as CLI tool
92
+ ---
69
93
 
70
- `yarn global add rev-dep`
94
+ # **Key Features 🚀**
71
95
 
72
- `npm -g install rev-dep`
96
+ * 🔍 **Reverse dependency lookup** — see all entry points that require a given file
97
+ * 🗂️ **Entry point discovery**
98
+ * 🧹 **Dead file detection**
99
+ * 📦 **Unused / missing / used node modules / dependencies analysis**
100
+ * 🔄 **Circular imports/dependencies detection**
101
+ * 🧭 **Trace all import paths between files**
102
+ * 📁 **List all files imported by any entry point**
103
+ * 📏 **Count actual lines of code (excluding comments, blanks and ai prompts)**
104
+ * 💽 **Node modules disk usage & size analysis**
105
+ * 💡 **Works with both JavaScript and TypeScript**
106
+ * ⚡ **Built for large codebases**
73
107
 
74
- `pnpm global add rev-dep`
108
+ ---
75
109
 
76
- ## Recipes 🌶️
110
+ # **Installation 📦**
77
111
 
78
- ### How to identify where a file is used in the project?
112
+ Install globally to use as a CLI tool:
79
113
 
80
- Just use `rev-dep resolve --file path/to/file.ts`
114
+ ```
115
+ yarn global add rev-dep
116
+ ```
81
117
 
82
- You will see all the entry points that implicitly require given file together with resolution path.
118
+ ```
119
+ npm install -g rev-dep
120
+ ```
83
121
 
84
- [`resolve` Command CLI reference](#rev-dep-resolve)
122
+ ```
123
+ pnpm global add rev-dep
124
+ ```
85
125
 
86
- #### Getting more details about file resolution in given entry point
126
+ ---
87
127
 
88
- To find out all paths combination use `rev-dep resolve` with `-a` flag
128
+ # **Quick Examples ⚡**
89
129
 
90
- > You might be surprised how complex dependency tree can be!
130
+ A few instant-use examples to get a feel for the tool:
91
131
 
92
- </details>
132
+ ```bash
133
+ # Find every entry point that depends on a file
134
+ rev-dep resolve --file src/utils/math.ts
93
135
 
94
- ### How to check if a file is used in the project?
136
+ # List all entry points in the project
137
+ rev-dep entry-points
95
138
 
96
- Use `rev-dep resolve --file path/to/file.ts --compact-summary`
139
+ # Detect unused node modules
140
+ rev-dep node-modules unused
97
141
 
98
- As a result you will see total amount of entry points requiring a given file.
142
+ # Check which files an entry point imports
143
+ rev-dep files --entry-point src/index.ts
99
144
 
100
- > Note that among the entry points list there might be some dead files importing the searched file
145
+ # Detect circular imports/dependencies
146
+ rev-dep circular
147
+ ```
101
148
 
102
- [`resolve` Command CLI reference](#rev-dep-resolve)
149
+ ---
103
150
 
104
- ### How to identify dead files in the project?
151
+ # **Practical Examples 🔧**
105
152
 
106
- Use `rev-dep entry-points` to get list of all files that are not required by any other files in the project.
107
153
 
108
- You might want to exclude some file paths that are meant to be actual entry point like `index.js` or `**/pages/**` in `next.js` projects using `--result-exclude` flag. The same for configuration files like `babel.config.js`
154
+ ### **How to identify where a file is used in the project**
109
155
 
110
- Review the list and look for suspicious files like `src/ui/components/SomeComponent/index.js`
156
+ ```
157
+ rev-dep resolve --file path/to/file.ts
158
+ ```
111
159
 
112
- [`entry-points` command CLI reference](#rev-dep-entry-points)
160
+ You’ll see all entry points that implicitly require that file, along with resolution paths.
113
161
 
114
- ### How to check which files are imported by a given file?
162
+ ---
115
163
 
116
- To get a full list of files imported by given entry point use `rev-dep files --entry-point path/to/file.ts`.
164
+ ### **How to check if a file is used**
117
165
 
118
- You can use `--count` flag if you are interested in the amount.
166
+ ```
167
+ rev-dep resolve --file path/to/file.ts --compact-summary
168
+ ```
119
169
 
120
- This is a good indicator of how heavy a given entry point or component is
170
+ Shows how many entry points indirectly depend on the file.
121
171
 
122
- [`files` command CLI reference](#rev-dep-files)
172
+ ---
123
173
 
124
- ### How to reduce amount of files imported by entry point?
174
+ ### **How to identify dead files**
125
175
 
126
- There is no easy how to for this process, but you can do it iteratively using `rev-dep` commands `files` and `resolve`
176
+ ```
177
+ rev-dep entry-points
178
+ ```
127
179
 
128
- 1. Get the list of files imported by entry-point
180
+ Exclude framework entry points if needed using `--result-exclude`.
129
181
 
130
- `rev-dep files --entry-point path/to/entry-point`
182
+ ---
131
183
 
132
- 2. Identify some suspicious files on the list, components that should not be used on the given page or not related utility files
133
- 3. Get all resolution paths for a suspicious file
184
+ ### **How to list all files imported by an entry point**
134
185
 
135
- `rev-dep resolve --file path/to/suspicious-file --entry-points path/to/entry-point --all`
186
+ ```
187
+ rev-dep files --entry-point path/to/file.ts
188
+ ```
136
189
 
137
- 4. You would usually find out that there is some file, like directory `index` file that given entry point is using, which is mandatory, but as a side effect it imports a few files that are redundant for your entry point. In most cases you should be able to decouple the imports or reverse the dependency to cut off the resolution path for the unwanted file
190
+ Useful for identifying heavy components or unintended dependencies.
138
191
 
139
- ### How to detect circular dependencies in the project?
192
+ ---
140
193
 
141
- Use `rev-dep circular` to find all circular dependencies between modules in your project.
194
+ ### **How to reduce unnecessary imports for an entry point**
142
195
 
143
- Circular dependencies can cause runtime errors, memory leaks, and make code difficult to understand and maintain. It's important to identify and resolve them early.
196
+ 1. List all files imported:
144
197
 
145
- You can use `--ignore-type-imports` flag to exclude type-only imports from the analysis if they're not relevant to your use case.
198
+ ```
199
+ rev-dep files --entry-point path/to/entry.ts
200
+ ```
201
+ 2. Identify suspicious files.
202
+ 3. Trace why they are included:
146
203
 
147
- [`circular` command CLI reference](#rev-dep-circular)
204
+ ```
205
+ rev-dep resolve --file path/to/suspect --entry-points path/to/entry.ts --all
206
+ ```
148
207
 
149
- ### How to find unused node modules?
208
+ ---
150
209
 
151
- Use `rev-dep node-modules unused` to identify packages that are installed but not actually imported in your code.
210
+ ### **How to detect circular dependencies**
152
211
 
153
- This helps clean up your `package.json` and reduce the size of your `node_modules` directory. You might want to exclude type definitions using `--exclude-modules=@types/*` since they're often used indirectly.
212
+ ```
213
+ rev-dep circular
214
+ ```
154
215
 
155
- [`node-modules unused` command CLI reference](#rev-dep-node-modules-unused)
216
+ ---
156
217
 
157
- ### How to identify space-consuming node modules?
218
+ ### **How to find unused node modules**
158
219
 
159
- Use `rev-dep node-modules dirs-size` to calculate and display the size of `node_modules` directories.
220
+ ```
221
+ rev-dep node-modules unused
222
+ ```
160
223
 
161
- This helps identify which packages are taking up the most disk space, allowing you to make informed decisions about dependency management or look for lighter alternatives.
224
+ ---
162
225
 
163
- For detailed analysis of specific modules, use `rev-dep node-modules analyze-size` with the package names you want to investigate.
226
+ ### **How to find missing node modules**
227
+
228
+ ```
229
+ rev-dep node-modules missing
230
+ ```
231
+
232
+ ---
233
+
234
+ ### **How to check node_modules space usage**
235
+
236
+ ```
237
+ rev-dep node-modules dirs-size
238
+ ```
164
239
 
165
- [`node-modules dirs-size` command CLI reference](#rev-dep-node-modules-dirs-size)
166
240
 
167
241
  ## Reimplemented to achieve 7x-37x speedup
168
242
 
@@ -177,7 +251,7 @@ Benchmark was run on TypeScript codebase with 507658 lines of code and 5977 sour
177
251
 
178
252
  Memory usage on Mac was measure using `/usr/bin/time` utility. Memory usage on Linux was not measured because I could't find reliable way to measure RAM usage on Linux. Subsequent runs had too much fluctuation.
179
253
 
180
- ### Mac book Pro M1 256GB, power save off;
254
+ ### MacBook Pro with Apple M1 chip, 16GB of RAM and 256GB of storage. Power save mode off
181
255
 
182
256
  | Command | V1 Time | V2 Time | Time Change | V1 RAM | V2 RAM | RAM Change |
183
257
  | ------------------------------------------------------------ | ------- | ------- | ----------- | ------ | ------ | ---------- |
@@ -307,8 +381,8 @@ rev-dep circular --ignore-types-imports
307
381
  -c, --cwd string Working directory for the command (default "$PWD")
308
382
  -h, --help help for circular
309
383
  -t, --ignore-type-imports Exclude type imports from the analysis
310
- --package-json string Path to package.json (default: ./package.json) (default "package.json")
311
- --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json) (default "tsconfig.json")
384
+ --package-json string Path to package.json (default: ./package.json)
385
+ --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
312
386
  ```
313
387
 
314
388
 
@@ -339,11 +413,11 @@ rev-dep entry-points --print-deps-count
339
413
  --graph-exclude strings Exclude files matching these glob patterns from analysis
340
414
  -h, --help help for entry-points
341
415
  -t, --ignore-type-imports Exclude type imports from the analysis
342
- --package-json string Path to package.json (default: ./package.json) (default "package.json")
416
+ --package-json string Path to package.json (default: ./package.json)
343
417
  --print-deps-count Show the number of dependencies for each entry point
344
418
  --result-exclude strings Exclude files matching these glob patterns from results
345
419
  --result-include strings Only include files matching these glob patterns in results
346
- --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json) (default "tsconfig.json")
420
+ --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
347
421
  ```
348
422
 
349
423
 
@@ -374,8 +448,8 @@ rev-dep files --entry-point src/index.ts
374
448
  -p, --entry-point string Entry point file to analyze (required)
375
449
  -h, --help help for files
376
450
  -t, --ignore-type-imports Exclude type imports from the analysis
377
- --package-json string Path to package.json (default: ./package.json) (default "package.json")
378
- --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json) (default "tsconfig.json")
451
+ --package-json string Path to package.json (default: ./package.json)
452
+ --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
379
453
  ```
380
454
 
381
455
 
@@ -575,9 +649,9 @@ rev-dep node-modules missing --entry-points=src/main.ts
575
649
  -h, --help help for missing
576
650
  -t, --ignore-type-imports Exclude type imports from the analysis
577
651
  -i, --include-modules strings list of modules to include in the output
578
- --package-json string Path to package.json (default: ./package.json) (default "package.json")
652
+ --package-json string Path to package.json (default: ./package.json)
579
653
  --pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
580
- --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json) (default "tsconfig.json")
654
+ --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
581
655
  --zero-exit-code Use this flag to always return zero exit code
582
656
  ```
583
657
 
@@ -613,9 +687,9 @@ rev-dep node-modules unused --exclude-modules=@types/*
613
687
  -h, --help help for unused
614
688
  -t, --ignore-type-imports Exclude type imports from the analysis
615
689
  -i, --include-modules strings list of modules to include in the output
616
- --package-json string Path to package.json (default: ./package.json) (default "package.json")
690
+ --package-json string Path to package.json (default: ./package.json)
617
691
  --pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
618
- --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json) (default "tsconfig.json")
692
+ --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
619
693
  --zero-exit-code Use this flag to always return zero exit code
620
694
  ```
621
695
 
@@ -653,9 +727,9 @@ rev-dep node-modules used -p src/index.ts --group-by-module
653
727
  -h, --help help for used
654
728
  -t, --ignore-type-imports Exclude type imports from the analysis
655
729
  -i, --include-modules strings list of modules to include in the output
656
- --package-json string Path to package.json (default: ./package.json) (default "package.json")
730
+ --package-json string Path to package.json (default: ./package.json)
657
731
  --pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
658
- --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json) (default "tsconfig.json")
732
+ --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
659
733
  ```
660
734
 
661
735
 
@@ -689,14 +763,93 @@ rev-dep resolve -p src/index.ts -f src/utils/helpers.ts
689
763
  --graph-exclude strings Glob patterns to exclude files from dependency analysis
690
764
  -h, --help help for resolve
691
765
  -t, --ignore-type-imports Exclude type imports from the analysis
692
- --package-json string Path to package.json (default: ./package.json) (default "package.json")
693
- --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json) (default "tsconfig.json")
766
+ --package-json string Path to package.json (default: ./package.json)
767
+ --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
694
768
  ```
695
769
 
696
770
 
697
771
 
698
772
  <!-- cli-docs-end -->
699
773
 
774
+ ## Circular check performance comparison
775
+
776
+ Benchmark performed on TypeScript codebase with `6034` source code files and `518862` lines of code.
777
+
778
+ Benchmark performed on MacBook Pro with Apple M1 chip, 16GB of RAM and 256GB of Storage. Power save mode off.
779
+
780
+ Benchmark performed with `hyperfine` using 8 runs per test and 4 warm up runs, taking mean time values as a result. If single run was taking more than 10s, only 1 run was performed.
781
+
782
+ `rev-dep` circular check is **12 times** faster than the fastest alternative❗
783
+
784
+ | Tool | Version | Command to Run Circular Check | Time |
785
+ |------|---------|-------------------------------|------|
786
+ | 🥇 [rev-dep](https://github.com/jayu/rev-dep) | 2.0.0 | `rev-dep circular` | 397 ms |
787
+ | 🥈 [dpdm-fast](https://github.com/SunSince90/dpdm-fast) | 1.0.14 | `dpdm --no-tree --no-progress --no-warning` + list of directories with source code | 4960 ms |
788
+ | 🥉 [dpdm](https://github.com/acrazing/dpdm) | 3.14.0 | `dpdm --no-warning` + list of directories with source code | 5030 ms |
789
+ | [skott](https://github.com/antoine-coulon/skott) | 0.35.6 | node skoscript using `findCircularDependencies` function | 29575 ms |
790
+ | [madge](https://github.com/pahen/madge) | 8.0.0 | `madge --circular --extensions js,ts,jsx,tsx .` | 69328 ms |
791
+ | [circular-dependency-scanner](https://github.com/emosheeep/circular-dependency-scanner) | 2.3.0 | `ds` - out of memory error | n/a |
792
+
793
+ ## Glossary
794
+
795
+ Some of the terms used in the problem space that **rev-dep** covers can be confusing.
796
+ Here is a small glossary to help you navigate the concepts.
797
+
798
+ ### Dependency
799
+
800
+ A *dependency* can be understood literally. In the context of a project’s dependency graph, it may refer to:
801
+
802
+ * a **node module / package** (a package is a dependency of a project or file), or
803
+ * a **source code file** (a file is a dependency of another file if it imports it).
804
+
805
+ ### Entry point
806
+
807
+ An *entry point* is a source file that is **not imported by any other file**.
808
+ It can represent:
809
+
810
+ * the main entry of the application
811
+ * an individual page or feature
812
+ * configuration or test bootstrap files
813
+
814
+ — depending on the project structure.
815
+
816
+ ### Unused / Dead file
817
+
818
+ A file is considered *unused* or *dead* when:
819
+
820
+ * it is an **entry point** (nothing imports it), **and**
821
+ * running it does **not produce any meaningful output** or side effect.
822
+
823
+ In practice, such files can often be removed safely.
824
+
825
+ ### Circular dependency
826
+
827
+ A *circular dependency* occurs when a file **directly or indirectly imports itself** through a chain of imports.
828
+
829
+ This can lead to unpredictable runtime behavior, uninitialized values, or subtle bugs.
830
+ However, circular dependencies between **TypeScript type-only imports** are usually harmless.
831
+
832
+ ### Reverse dependency (or "dependents")
833
+
834
+ Files that *import* a given file.
835
+ Useful for answering: "What breaks if I change or delete this file?"
836
+
837
+ ### Import graph / Dependency graph
838
+
839
+ A visual representation of how files or modules import each other.
840
+
841
+ ### Missing dependency / unused node module
842
+
843
+ A module that your code imports but is **not listed in package.json**.
844
+
845
+ ### Unused dependency / unused node module
846
+
847
+ A dependency listed in **package.json** that is **never imported** in the source code.
848
+
849
+ ### Root directory / Project root
850
+
851
+ The top-level directory used as the starting point for dependency analysis.
852
+
700
853
  ## Made in 🇵🇱 and 🇯🇵 with 🧠 by [@jayu](https://github.com/jayu)
701
854
 
702
855
  I hope that this small piece of software will help you discover and understood complexity of your project hence make you more confident while refactoring. If this tool was useful, don't hesitate to give it a ⭐!
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rev-dep",
3
- "version": "2.0.0",
4
- "description": "Dependency debugging tool for JavaScript and TypeScript projects",
3
+ "version": "2.1.0",
4
+ "description": "Trace imports, detect unused code, clean dependencies — all with a super-fast CLI",
5
5
  "bin": "bin.js",
6
6
  "files": [
7
7
  "bin.js"
@@ -17,28 +17,30 @@
17
17
  "node": ">=18"
18
18
  },
19
19
  "optionalDependencies": {
20
- "@rev-dep/darwin-arm64": "2.0.0",
21
- "@rev-dep/linux-x64": "2.0.0"
20
+ "@rev-dep/darwin-arm64": "2.1.0",
21
+ "@rev-dep/linux-x64": "2.1.0"
22
22
  },
23
23
  "keywords": [
24
- "dependencies",
25
- "deps",
26
- "dependency graph",
27
- "dependency debugging",
28
- "entry points",
29
- "dependency resolution",
30
- "reverse dependency resolution",
31
- "import path",
32
- "resolution path",
33
- "dependency optimization",
34
- "dependency analysis",
35
- "bundle",
36
- "dependency tree",
37
- "imports",
38
- "dependencies checking",
39
- "imports debugging",
40
- "imports analysis",
41
- "imports search",
42
- "file dependencies"
24
+ "dependency-analysis",
25
+ "reverse-dependencies",
26
+ "dependency-resolution",
27
+ "file-dependencies",
28
+ "unused-files",
29
+ "dead-files",
30
+ "unused-dependencies",
31
+ "missing-dependencies",
32
+ "used-dependencies",
33
+ "module-analysis",
34
+ "import-analysis",
35
+ "entry-point-analysis",
36
+ "dependency-path",
37
+ "circular-dependency-detection",
38
+ "node-modules-analysis",
39
+ "module-size-analysis",
40
+ "lines-of-code",
41
+ "project-audit",
42
+ "typescript-analysis",
43
+ "javascript-analysis",
44
+ "monorepo-analysis"
43
45
  ]
44
46
  }