{"id":22202708,"url":"https://github.com/namchee/dependent","last_synced_at":"2025-07-11T22:05:40.054Z","repository":{"id":39759924,"uuid":"388645376","full_name":"Namchee/dependent","owner":"Namchee","description":"Simple utility CLI tool to analyze which files are using a Node dependency 🚀","archived":false,"fork":false,"pushed_at":"2023-08-12T13:48:42.000Z","size":603,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T07:48:32.963Z","etag":null,"topics":["cli","dependency","nodejs","parser","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Namchee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-23T01:33:57.000Z","updated_at":"2022-05-25T14:17:40.000Z","dependencies_parsed_at":"2024-10-29T18:35:10.938Z","dependency_job_id":null,"html_url":"https://github.com/Namchee/dependent","commit_stats":{"total_commits":220,"total_committers":3,"mean_commits":73.33333333333333,"dds":0.031818181818181857,"last_synced_commit":"3893e46069ff3f2cb708abcbd378a5019e4bd95a"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/Namchee/dependent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Namchee%2Fdependent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Namchee%2Fdependent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Namchee%2Fdependent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Namchee%2Fdependent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Namchee","download_url":"https://codeload.github.com/Namchee/dependent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Namchee%2Fdependent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264904300,"owners_count":23681175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","dependency","nodejs","parser","typescript"],"created_at":"2024-12-02T16:37:02.756Z","updated_at":"2025-07-11T22:05:39.977Z","avatar_url":"https://github.com/Namchee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dependent\n\n[![NPM package version](https://img.shields.io/npm/v/@namchee/dependent)](https://www.npmjs.com/package/@namchee/dependent) [![Code Style: Google](https://img.shields.io/badge/code%20style-google-blueviolet.svg)](https://github.com/google/gts) ![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg) ![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/namchee/dependent)\n\n\u003e This project is still on active development. The API ***might** change without further notice.\n\nDependent is a simple utility CLI to find out which files in your NodeJS-based projects are using a certain dependency. 🚀\n\n![Demo](docs/demo.gif)\n\n## Features\n\n- 📦 Analyze dependency usage from all files in your project.\n- 🚀 Blazing fast file parsing.\n- 📁 Configurable path, analyze files that are actually relevant.\n- ☑️ Failsafe parsing mode, no more failure caused by single file error.\n- 📈 Expanding language support.\n\n## Language Support\n\n`dependent` is able to parse files with the following extensions:\n\n1. Standard JavaScript files, `.js`\n2. ESModules, `.mjs`\n3. TypeScript files, `.ts`\n4. React Extended JavaScript and TypeScript, `.jsx` and `.tsx`\n5. Vue Single File Components, `.vue` (`.js` and `.ts` scripts only)\n6. Svelte Single File Components, `.svelte`\n7. Astro Components, `.astro`\n\nMore language support are incoming! Submit your language support ideas [here](https://github.com/Namchee/dependent/issues/new/choose)\n\nWant to help `dependent` to be able to parse your favorite files? [Submit a pull request](https://github.com/Namchee/dependent/pulls)\n## Installation\n\nYou can install `dependent` globally with your favorite package manager. Below is the example of installation with `npm`.\n\n```bash\nnpm install -g @namchee/dependent\n```\n\nAlternatively, you can execute `dependent` without installing it by using `npx`. Below is the example of executing `dependent` with `npx`\n\n```bash\nnpx @namchee/dependent foo\n```\n\n\u003e This package can only be executed on NodeJS 12 or later.\n\n## Usage\n\n\u003e Make sure that you have a working NodeJS installation! Refer to [this instruction](https://nodejs.org/en/download/) about how to setup NodeJS on your machine\n\n`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:\n\n```bash\n# Which files that requires `express` in my project?\ndependent express\n```\n\nBy default, `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](https://en.wikipedia.org/wiki/Glob_(programming)) that you want to analyze. For example\n\n```bash\n# Only analyze TypeScript files in the `src` directory\ndependent express src/**/*.ts\n```\n\nAfter the command is given, `dependent` will produce a list of dependant files in your terminal. For example\n\n```bash\n✔ Analysis completed successfully\n\n📦 There are 17 files in this project that depends on 'phaser'\n\n📁 TypeScript Files\n└── index.ts:1 → src/index.ts\n└── assets.ts:1 → src/utils/assets.ts\n└── background.ts:1 → src/utils/background.ts\n└── cherry.ts:1 → src/objects/cherry.ts\n└── flyer.ts:1 → src/objects/flyer.ts\n└── game.ts:1 → src/scenes/game.ts\n└── mushroom.ts:1 → src/objects/mushroom.ts\n└── pause.ts:1 → src/scenes/pause.ts\n└── player.ts:1 → src/objects/player.ts\n└── preload.ts:1 → src/scenes/preload.ts\n└── result.ts:1 → src/scenes/result.ts\n└── saw.ts:1 → src/objects/saw.ts\n└── spike.ts:1 → src/objects/spike.ts\n└── splash.ts:1 → src/scenes/splash.ts\n└── title.ts:1 → src/scenes/title.ts\n└── trophy.ts:1 → src/objects/trophy.ts\n└── ui.ts:1 → src/utils/ui.ts\n```\n\nCongratulation, you've used `dependent` successfully! 🎉\n\n## CLI Reference\n\n### Required Arguments\n\n### `package`\n\n`string`\n\nDependency name to be analyzed. Must be defined in `package.json` and installed in `node_modules`.\n\n### Optional Arguments\n\n### `files`\n\n`string[]`\n\nA list of glob patterns that specifies the directories to be analyzed. Space separated.\n\nFor example, the argument below will make `dependent` to analyze all JavaScript files that depends on `express` in `src` and `lib` directory.\n\n```bash\ndependent express src/**/*.js lib/**/*.js\n```\n\n### Flags\n\n### `--help`, `-h`\n\nShow the help menu.\n\n### `--silent`, `-s`\n\nSuppress all parsing errors. Default: `false`\n\n### `--table`, `-t`\n\nOutputs the result in table-style format instead of line per line format. Default `false`\n\n## FAQ\n\n### My vue files cannot be parsed. Help!\n\n`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!\n\n### `dependent` does not support TypeScript on Svelte files!\n\nSvelte compiler won't parse anything that is not a JavaScript. Technically, this can be mitigated by doing preprocessing steps like compilation or transpilation. However, this may lead to inaccurate analysis as the code changes which leads to line number changes. We are still looking for the best solution for this.\n\n## Motivation\n\nIt'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.\n\nSadly, 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 💥.\n\nThe above scenario is fine for small projects since they are easier to test and execute (and compile, if you're using a superset of JavaScript). But, what about big projects where it took so long to execute and compile? What about dynamic imports in not-fully-tested projects where the code may fail silently? What if there's a new team member who want to get onboard quickly but getting stuck on understanding why and where a dependency is needed?\n\nThis 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.\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamchee%2Fdependent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamchee%2Fdependent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamchee%2Fdependent/lists"}