{"id":13553282,"url":"https://github.com/pichillilorenzo/deps-report","last_synced_at":"2025-04-15T05:53:09.732Z","repository":{"id":85320390,"uuid":"138339355","full_name":"pichillilorenzo/deps-report","owner":"pichillilorenzo","description":"Generate reports about dependencies and dependents of your JavaScript/TypeScript files through an AST. It supports import and require statements.","archived":false,"fork":false,"pushed_at":"2020-06-02T23:34:32.000Z","size":210,"stargazers_count":84,"open_issues_count":7,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T16:38:00.670Z","etag":null,"topics":["abstract-syntax-tree","ast","dependency-analysis","dependency-management","dependency-manager","flow","javascript","javascript-tools","npm-package","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/pichillilorenzo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-06-22T19:10:30.000Z","updated_at":"2023-12-17T09:41:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3249420-0c2c-42f5-98f1-90f98601a54a","html_url":"https://github.com/pichillilorenzo/deps-report","commit_stats":{"total_commits":50,"total_committers":2,"mean_commits":25.0,"dds":0.07999999999999996,"last_synced_commit":"c02513d1a9d8f4d412e002d8ff955801e223b1ec"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pichillilorenzo%2Fdeps-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pichillilorenzo%2Fdeps-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pichillilorenzo%2Fdeps-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pichillilorenzo%2Fdeps-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pichillilorenzo","download_url":"https://codeload.github.com/pichillilorenzo/deps-report/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631687,"owners_count":21136562,"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":["abstract-syntax-tree","ast","dependency-analysis","dependency-management","dependency-manager","flow","javascript","javascript-tools","npm-package","typescript"],"created_at":"2024-08-01T12:02:21.342Z","updated_at":"2025-04-15T05:53:09.712Z","avatar_url":"https://github.com/pichillilorenzo.png","language":"JavaScript","funding_links":["https://www.paypal.me/LorenzoPichilli","https://www.patreon.com/bePatron?u=9269604"],"categories":["JavaScript","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"# deps-report\n\n![node version](https://img.shields.io/node/v/deps-report.svg)\n[![npm downloads](https://img.shields.io/npm/dm/deps-report.svg)](https://www.npmjs.com/package/deps-report)\n[![deps-report version](https://img.shields.io/npm/v/deps-report.svg)](https://www.npmjs.com/package/deps-report)\n[![Travis](https://img.shields.io/travis/pichillilorenzo/deps-report.svg?branch=master)](https://travis-ci.org/pichillilorenzo/deps-report)\n[![Coverage Status](https://coveralls.io/repos/github/pichillilorenzo/deps-report/badge.svg?branch=master)](https://coveralls.io/github/pichillilorenzo/deps-report?branch=master)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](/LICENSE.txt)\n[![Greenkeeper badge](https://badges.greenkeeper.io/pichillilorenzo/deps-report.svg)](https://greenkeeper.io/)\n[![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/LorenzoPichilli)\n[![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/bePatron?u=9269604)\n\nGenerate reports about dependencies and dependents of your JavaScript/TypeScript files through an **AST**. It supports `import` and `require` statements.\n\nParsers used:\n  - [flow-parser](https://www.npmjs.com/package/flow-parser) for `.js` files\n  - [typescript](https://github.com/Microsoft/TypeScript) for `.ts` files\n\n\n## Install\n\n```\nnpm install -g deps-report\n```\n\n## Screenshots\n![](https://drive.google.com/uc?authuser=0\u0026id=1GHYVTXM6KSaAtjOvNqA-2Q-z5TKc-nQC\u0026export=download)\n\n\n## CLI Usage\n\n```\nUsage: deps-report [options] [command]\n\nOptions:\n\n  -V, --version                             output the version number\n  -j, --json                                Output results in JSON format\n  -p, --pretty                              Pretty-print JSON output (implies --json)\n  -a, --abs-path                            Print absolute path of dependencies/dependents\n  -e, --exclude-node-modules                Don't consider node_modules dependencies\n  -w, --webpack-config [webpackConfigFile]  Webpack config file for resolving aliased modules\n  -s, --specifiers                          Show specifiers imported by the dependency/dependent\n  --no-color                                Display terminal output without colors\n  -h, --help                                output usage information\n\nCommands:\n\n  find-dependencies [options] \u003cglob\u003e [otherGlobs...]\n\n      Usage: find-dependencies [options] \u003cglob\u003e [otherGlobs...]\n      Options:\n\n        -c, --circular      Show if there are some circular dependencies\n        --only-not-found    Show all modules that have no dependencies\n        --hide-not-found    Hide all modules that have no dependencies\n        --only-circular     Show only circular dependencies\n        -h, --help          output usage information\n\n\n  find-dependents [options] \u003cglob\u003e [otherGlobs...]\n\n      Usage: find-dependents [options] \u003cglob\u003e [otherGlobs...]\n      Options:\n\n        -r, --root [root]   Root folder from where to start the search. Default is the dirname of each glob entry\n        -c, --circular      Show if there are some circular dependencies\n        --only-not-found    Show all modules that no one is depending on\n        --hide-not-found    Hide all modules that no one is depending on\n        --only-circular     Show only circular dependencies\n        -h, --help          output usage information\n\n```\n\n\n## Examples find-dependencies\n\n```\n$ deps-report find-dependencies tests/project-react-js-test/src/App.js\n\nProcessed 1 file in 122.297ms.\n\ntests/project-react-js-test/src/App.js, found 3 dependencies:\n 1) react\n 2) ./logo.svg\n 3) ./App.css\n\n\n$ deps-report -s find-dependencies tests/project-react-js-test/src/App.js\n\nProcessed 1 file in 127.538ms.\n\ntests/project-react-js-test/src/App.js, found 3 dependencies:\n 1) react, specifiers imported: default as React, Component\n 2) ./logo.svg, specifiers imported: default as logo\n 3) ./App.css\n\n\n$ deps-report -a find-dependencies 'tests/project-react-js-test/src/*.js'\n\nProcessed 4 files in 149.446ms.\n\ntests/project-react-js-test/src/App.js, found 3 dependencies:\n 1) react\n 2) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/logo.svg\n 3) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.css\n\ntests/project-react-js-test/src/App.test.js, found 3 dependencies:\n 1) react\n 2) react-dom\n 3) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\n\ntests/project-react-js-test/src/index.js, found 5 dependencies:\n 1) react\n 2) react-dom\n 3) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/index.css\n 4) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\n 5) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/registerServiceWorker.js\n\ntests/project-react-js-test/src/registerServiceWorker.js, found 0 dependencies:\n    No dependencies found!\n\n\n$ deps-report -ae find-dependencies 'tests/project-react-js-test/src/*.js'\n\nProcessed 4 files in 139.507ms.\n\ntests/project-react-js-test/src/App.js, found 2 dependencies:\n 1) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/logo.svg\n 2) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.css\n\ntests/project-react-js-test/src/App.test.js, found 1 dependency:\n 1) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\n\ntests/project-react-js-test/src/index.js, found 3 dependencies:\n 1) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/index.css\n 2) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\n 3) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/registerServiceWorker.js\n\ntests/project-react-js-test/src/registerServiceWorker.js, found 0 dependencies:\n    No dependencies found!\n\n\n$ deps-report -ae find-dependencies 'tests/project-react-js-test/src/*.js' '!tests/project-react-js-test/src/**/*.test.js'\n\nProcessed 3 files in 141.737ms.\n\ntests/project-react-js-test/src/App.js, found 2 dependencies:\n 1) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/logo.svg\n 2) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.css\n\ntests/project-react-js-test/src/index.js, found 3 dependencies:\n 1) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/index.css\n 2) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\n 3) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/registerServiceWorker.js\n\ntests/project-react-js-test/src/registerServiceWorker.js, found 0 dependencies:\n    No dependencies found!\n\n\n$ deps-report -w tests/project-test/webpack.config.js find-dependencies tests/project-test/a.js\n\nProcessed 1 file in 109.559ms.\n\ntests/project-test/a.js, found 12 dependencies:\n 1) path\n 2) fs\n 3) ./c/d.js\n 4) Utilities/index.js\n 5) UtilitiesRelativePath\n 6) Utilities/utilityA.js\n 7) Templates/main.js\n 8) TemplatesMain\n 9) MyPath\n10) fs\n11) ./e/b.js\n12) ./c/d.js\n\n\n$ deps-report -w tests/project-test/webpack.config.js find-dependencies --only-circular tests/project-test/a.js\n\nProcessed 1 file in 153.199ms.\n\ntests/project-test/a.js, found 2 dependencies:\n 1) ./c/d.js\n 2) ./c/d.js\n\n\n$ deps-report -ae -w tests/project-test/webpack.config.js find-dependencies tests/project-test/a.js\n\nProcessed 1 file in 118.478ms.\n\ntests/project-test/a.js, found 8 dependencies:\n 1) /Users/lorenzo/Desktop/deps-report/tests/project-test/c/d.js\n 2) /Users/lorenzo/Desktop/deps-report/tests/project-test/src/utilities/index.js\n 3) /Users/lorenzo/Desktop/deps-report/tests/project-test/src/utilities/relative.js\n 4) /Users/lorenzo/Desktop/deps-report/tests/project-test/src/utilities/utilityA.js\n 5) /Users/lorenzo/Desktop/deps-report/tests/project-test/src/templates/main.js\n 6) /Users/lorenzo/Desktop/deps-report/tests/project-test/src/templates/main.js\n 7) /Users/lorenzo/Desktop/deps-report/tests/project-test/e/b.js\n 8) /Users/lorenzo/Desktop/deps-report/tests/project-test/c/d.js\n\n\n$ deps-report -w tests/project-test/webpack.config.js find-dependencies --only-not-found \"tests/project-test/*.ts\"\n\nProcessed 1 file in 42.623ms.\n\ntests/project-test/c.ts\n```\n\nJSON format example:\n\n```\n$ deps-report -jps find-dependencies -c tests/project-react-js-test/src/App.js\n\n{\n  \"tests/project-react-js-test/src/App.js\": {\n    \"absolutePath\": \"/Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\",\n    \"files\": 3,\n    \"dependencies\": [\n      {\n        \"importPath\": \"react\",\n        \"importAbsolutePath\": \"react\",\n        \"isCircularDependency\": null,\n        \"isNodeModule\": true,\n        \"specifiers\": [\n          {\n            \"name\": \"React\",\n            \"alias\": \"\",\n            \"isDefault\": true\n          },\n          {\n            \"name\": \"Component\",\n            \"alias\": \"\",\n            \"isDefault\": false\n          }\n        ]\n      },\n      {\n        \"importPath\": \"./logo.svg\",\n        \"importAbsolutePath\": \"/Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/logo.svg\",\n        \"isCircularDependency\": false,\n        \"isNodeModule\": false,\n        \"specifiers\": [\n          {\n            \"name\": \"logo\",\n            \"alias\": \"\",\n            \"isDefault\": true\n          }\n        ]\n      },\n      {\n        \"importPath\": \"./App.css\",\n        \"importAbsolutePath\": \"/Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.css\",\n        \"isCircularDependency\": false,\n        \"isNodeModule\": false,\n        \"specifiers\": []\n      }\n    ]\n  }\n}\n```\n\n\n## Examples find-dependents\n\n```\n$ deps-report find-dependents tests/project-react-js-test/src/App.js\n\nProcessed 1 file in 199.088ms.\n\ntests/project-react-js-test/src/App.js, found 2 dependents:\n 1) tests/project-react-js-test/src/App.test.js\n 2) tests/project-react-js-test/src/index.js\n\n\n$ deps-report -s find-dependents tests/project-react-js-test/src/App.js\n\nProcessed 1 file in 197.761ms.\n\ntests/project-react-js-test/src/App.js, found 2 dependents:\n 1) tests/project-react-js-test/src/App.test.js, specifiers imported: default as App\n 2) tests/project-react-js-test/src/index.js, specifiers imported: default as App\n\n\n$ deps-report -as find-dependents tests/project-react-js-test/src/App.js\n\nProcessed 1 file in 199.046ms.\n\ntests/project-react-js-test/src/App.js, found 2 dependents:\n 1) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.test.js, specifiers imported: default as App\n 2) /Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/index.js, specifiers imported: default as App\n\n\n$ deps-report find-dependents tests/project-test/a1.ts\n\nProcessed 1 file in 191.590ms.\n\ntests/project-test/a1.ts, found 0 dependents:\n    No dependents found!\n\n\n$ deps-report find-dependents -c -r tests/project-test tests/project-test/c/d.js\n\nProcessed 1 file in 218.268ms.\n\ntests/project-test/c/d.js, found 4 dependents:\n 1) tests/project-test/a.js, Circular Dependency\n 2) tests/project-test/e/b.js\n 3) tests/project-test/a.ts\n 4) tests/project-test/b.ts\n\n\n$ deps-report -es -w tests/project-test/webpack.config.js find-dependents -r tests/project-test/ tests/project-test/src/utilities/index.js tests/project-test/src/templates/main.js\n\nProcessed 2 files in 852.220ms.\n\ntests/project-test/src/utilities/index.js, found 2 dependents:\n 1) tests/project-test/a.js, specifiers imported: default as Utilities\n 2) tests/project-test/a.ts, specifiers imported: default as Utilities\n\ntests/project-test/src/templates/main.js, found 3 dependents:\n 1) tests/project-test/a.js, specifiers imported: default as templates\n 2) tests/project-test/src/utilities/index.js, specifiers imported: default as templates\n 3) tests/project-test/a.ts, specifiers imported: default as templates\n```\n\nYou can search also **images** and **css** files imported in your javascript files (such as in a React project):\n\n```\n$ deps-report -s find-dependents tests/project-react-js-test/src/logo.svg\n\nProcessed 1 file in 218.263ms.\n\ntests/project-react-js-test/src/logo.svg, found 1 dependent:\n 1) tests/project-react-js-test/src/App.js, specifiers imported: default as logo\n\n\n$ deps-report find-dependents tests/project-react-js-test/src/App.css\n\nProcessed 1 file in 213.301ms.\n\ntests/project-react-js-test/src/App.css, found 1 dependent:\n 1) tests/project-react-js-test/src/App.js\n```\n\nJSON format example:\n\n```\n$ deps-report -jps find-dependents -c tests/project-react-js-test/src/App.js\n\n{\n  \"tests/project-react-js-test/src/App.js\": {\n    \"absolutePath\": \"/Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\",\n    \"files\": 2,\n    \"dependents\": [\n      {\n        \"filePath\": \"tests/project-react-js-test/src/App.test.js\",\n        \"fileAbsolutePath\": \"/Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.test.js\",\n        \"importPath\": \"./App.js\",\n        \"importAbsolutePath\": \"/Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\",\n        \"isCircularDependency\": false,\n        \"specifiers\": [\n          {\n            \"name\": \"App\",\n            \"alias\": \"\",\n            \"isDefault\": true\n          }\n        ]\n      },\n      {\n        \"filePath\": \"tests/project-react-js-test/src/index.js\",\n        \"fileAbsolutePath\": \"/Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/index.js\",\n        \"importPath\": \"./App.js\",\n        \"importAbsolutePath\": \"/Users/lorenzo/Desktop/deps-report/tests/project-react-js-test/src/App.js\",\n        \"isCircularDependency\": false,\n        \"specifiers\": [\n          {\n            \"name\": \"App\",\n            \"alias\": \"\",\n            \"isDefault\": true\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n\n## API Usage\n\n```javascript\nconst depsReport = require('deps-report')\n\n// find-dependencies command options\n\nlet optionsFindDependencies = {\n  circular: false,              // if true, it will try to see if there are some circular dependencies with input files\n  onlyCircular: false,          // if true, it will return only dependecies with circular dependency with input files\n  onlyNotFound: false,          // if true, it will return all modules that have no dependencies\n  hideNotFound: false,          // used only for CLI output\n  parent: {\n    excludeNodeModules: false,  // if true, it will exclude all node modules\n    json: false,                // used only for CLI output\n    pretty: false,              // used only for CLI output\n    absPath: false,             // used only for CLI output\n    color: false,               // used only for CLI output\n    webpackConfig: 'tests/project-test/webpack.config.js', // used to resolve module aliases\n    specifiers: false           // if true, it will populate the specifiers imported by the dependency\n  } \n}\n\n// see the corresponding JSON format example\ndepsReport.findDependencies([\"tests/project-test/a.js\"], optionsFindDependencies)\n\n\n// find-dependents command options\n\nlet optionsFindDependents = {\n  root: 'tests/project-test',   // Root folder from where to start the search of dependents\n  circular: false,              // if true, it will try to see if there are some circular dependencies with input files\n  onlyCircular: false,          // if true, it will return only dependents with circular dependency with input files\n  onlyNotFound: false,          // if true, it will return all modules that no one is depending on\n  hideNotFound: false,          // used only for CLI output\n  parent: {\n    excludeNodeModules: false,  // if true, it will exclude all node modules\n    json: false,                // used only for CLI output\n    pretty: false,              // used only for CLI output\n    absPath: false,             // used only for CLI output\n    color: false,               // used only for CLI output\n    webpackConfig: 'tests/project-test/webpack.config.js', // used to resolve module aliases\n    specifiers: false           // if true, it will populate the specifiers imported by the dependent\n  } \n}\n\n// see the corresponding JSON format example\ndepsReport.findDependents([\"tests/project-test/src/templates/*.js\", \"tests/project-test/src/utilities/*.js\"], optionsFindDependents)\n```\n\n## Support\n\n### Feature request/enhancement\nFor feature requests/enhancement, create an issue!\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/LorenzoPichilli)\n[![Become a Patron](https://img.shields.io/badge/-Become%20a%20Patron!-red.svg?style=for-the-badge)](https://www.patreon.com/bePatron?u=9269604)\n\n\n## License\n\n_MIT License_","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpichillilorenzo%2Fdeps-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpichillilorenzo%2Fdeps-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpichillilorenzo%2Fdeps-report/lists"}