This project is still on active development. The API *might change without further notice.
Dependent is a simple utility CLI to find out which files in your NodeJS-based projects are using a certain dependency. 🚀
dependent is able to parse files with the following extensions:
More language support are incoming! Submit your language support ideas here
Want to help
dependent to be able to parse your favorite files? Submit a pull request
You can install
dependent globally with your favorite package manager. Below is the example of installation with
npm install -g @namchee/dependent
Alternatively, you can execute
dependent without installing it by using
npx. Below is the example of executing
npx @namchee/dependent foo
This package can only be executed on NodeJS 12 or later.
Make sure that you have a working NodeJS installation! Refer to this instruction about how to setup NodeJS on your machine
dependent can be executed by your favorite terminal by executing
dependent and supplying the name of the package that you want to analyze. For example:
# Which files that requires `express` in my project? dependent express
dependent will try to parse all supported files - except
node_modules - in your project directory. To configure
dependent to only scan specific files,
dependent accepts an extra argument called
files which is a list of glob patterns that you want to analyze. For example
# Only analyze TypeScript files in the `src` directory dependent express src/**/*.ts
After the command is given,
dependent will produce a list of dependant files in your terminal. For example
✔ Analysis completed successfully 📦 There are 17 files in this project that depends on 'phaser' 📁 TypeScript Files └── index.ts:1 → src/index.ts └── assets.ts:1 → src/utils/assets.ts └── background.ts:1 → src/utils/background.ts └── cherry.ts:1 → src/objects/cherry.ts └── flyer.ts:1 → src/objects/flyer.ts └── game.ts:1 → src/scenes/game.ts └── mushroom.ts:1 → src/objects/mushroom.ts └── pause.ts:1 → src/scenes/pause.ts └── player.ts:1 → src/objects/player.ts └── preload.ts:1 → src/scenes/preload.ts └── result.ts:1 → src/scenes/result.ts └── saw.ts:1 → src/objects/saw.ts └── spike.ts:1 → src/objects/spike.ts └── splash.ts:1 → src/scenes/splash.ts └── title.ts:1 → src/scenes/title.ts └── trophy.ts:1 → src/objects/trophy.ts └── ui.ts:1 → src/utils/ui.ts
Congratulation, you've used
dependent successfully! 🎉
Dependency name to be analyzed. Must be defined in
package.json and installed in
A list of glob patterns that specifies the directories to be analyzed. Space separated.
For example, the argument below will make
dependent express src/**/*.js lib/**/*.js
Show the help menu.
Suppress all parsing errors. Default:
Outputs the result in table-style format instead of line per line format. Default
dependent will only support Vue 3 projects. I don't plan to add Vue 2 support as Vue 3 is already stable. Feel free to create PR for this though!
dependentdoes not support TypeScript on Svelte files!
It's Friday! Since tomorrow is free, you want to finish your work as soon as possible and enjoy your temporary holiday.After some refactoring, you realized package
x is not used anymore in the files your refactored in your NodeJS based project. Realizing this, you proceed to execute
npm uninstall x and then the uninstallation completed successfully.
Sadly, you don't realize that
x is actually imported by another files that you didn't touch at all. Your project now breaks by your careless mistake 💥.
This utility aims to fix those issues by automatically analyzing dependency usage in your projects and produce human-readable logs. Focus on your actual code, not on your dependency management. Let
dependent analyze what dependency is actually needed and what isn't.
This project is licensed under the MIT License.