{"id":22423284,"url":"https://github.com/prantlf/requirejs-dependencies","last_synced_at":"2026-07-10T21:31:32.503Z","repository":{"id":57354403,"uuid":"267264930","full_name":"prantlf/requirejs-dependencies","owner":"prantlf","description":"Finds direct and indirect dependencies of one or more RequireJS modules.","archived":false,"fork":false,"pushed_at":"2020-07-03T07:23:15.000Z","size":295,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T04:16:25.619Z","etag":null,"topics":["amd","amdjs","dependencies","module","requirejs","trace","tracer"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/prantlf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-27T08:33:19.000Z","updated_at":"2020-07-03T07:21:50.000Z","dependencies_parsed_at":"2022-09-12T06:00:44.110Z","dependency_job_id":null,"html_url":"https://github.com/prantlf/requirejs-dependencies","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/prantlf/requirejs-dependencies","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frequirejs-dependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frequirejs-dependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frequirejs-dependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frequirejs-dependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prantlf","download_url":"https://codeload.github.com/prantlf/requirejs-dependencies/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frequirejs-dependencies/sbom","scorecard":{"id":743759,"data":{"date":"2025-08-11","repo":{"name":"github.com/prantlf/requirejs-dependencies","commit":"14f6ed3a228e0eef401043e96198b60ed3931216"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"31 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-vc8w-jr9v-vj7f","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T18:11:20.710Z","repository_id":57354403,"created_at":"2025-08-22T18:11:20.710Z","updated_at":"2025-08-22T18:11:20.710Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35344523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-10T02:00:06.465Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["amd","amdjs","dependencies","module","requirejs","trace","tracer"],"created_at":"2024-12-05T18:09:52.676Z","updated_at":"2026-07-10T21:31:32.474Z","avatar_url":"https://github.com/prantlf.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# requirejs-dependencies\n\n[![npm](https://img.shields.io/npm/v/requirejs-dependencies)](https://www.npmjs.com/package/requirejs-dependencies#top)\n[![Build Status](https://travis-ci.org/prantlf/requirejs-dependencies.svg?branch=master)](https://travis-ci.org/prantlf/requirejs-dependencies)\n[![Dependency Status](https://david-dm.org/prantlf/requirejs-dependencies.svg)](https://david-dm.org/prantlf/requirejs-dependencies)\n[![devDependency Status](https://david-dm.org/prantlf/requirejs-dependencies/dev-status.svg)](https://david-dm.org/prantlf/requirejs-dependencies#info=devDependencies)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nFinds direct and indirect dependencies of a RequireJS module. Can be used to find all or only common dependencies of more modules, for example:\n\n```\nrequirejs-dependencies -r src -c src/config.js --common src/store src/shell\n```\n\nThis package supports RequireJS specifics like plugins and bundles. If multiple bundles are used, dependencies between bundles can be represented by imploding modules from a single bundle to the single bundle name in the traced output.\n\n## Synopsis\n\n```\n$ requirejs-dependencies -r src -c src/config.js src/main\nsrc/main.js\nsrc/utils.js\nsrc/main traced in 5.742ms\n```\n\n```js\nimport { traceSingle } from 'requirejs-dependencies'\nconst { traced } = await traceSingle({\n  module: 'src/main', rootDir: 'src', config: 'src/config.js'\n})\nfor (const { id } of traced) console.log(id)\n// Prints src/main.js and src/utils.js\n```\n\n## Installation\n\nIf you want to use the command-line tool, install this package globally using your package manager:\n\n```\nnpm i -g requirejs-dependencies\nyarn global add requirejs-dependencies\npnpm i -g requirejs-dependencies\n```\n\nIf you want to use this package programmatically, install it locally using your package manager:\n\n```\nnpm i requirejs-dependencies\nyarn add requirejs-dependencies\npnpm i requirejs-dependencies\n```\n\nIf you want to render graphs to `png` on the command line, install the peer dependency `canvas` in the same way as you did the module `requirejs-dependencies` above.\n\nIf you want to use the web application (argument `--serve`) install the peer dependency `graphviz-webcomponent` in the same way as you did the module `requirejs-dependencies` above.\n\n## API\n\n### traceSingle(options: object): Promise\\\u003cobject\\\u003e\n\nFinds direct and indirect dependencies of a RequireJS module.\n\n```js\nimport { traceSingle } from 'requirejs-dependencies'\nconst { traced, time } = await traceSingle({\n  module: 'src/main', rootDir: 'src', config: 'src/config.js'\n})\nfor (const { id, path, deps, dependents } of traced) { ... }\n```\n\nAvailable options:\n\n|  name             |  type    | description                                     |\n|-------------------|----------|-------------------------------------------------|\n| `module`          | `string` | module name recognized by RequireJS (mandatory) |\n| `rootDir`         | `string` | source root directory (mandatory)               |\n| `config`          | `string` | configuration file for RequireJS (optional)     |\n\nPromised result properties:\n\n|  name     |  type      | description                                |\n|-----------|------------|--------------------------------------------|\n| `traced`  | `object[]` | list of dependencies                       |\n| `time`    | `number`   | time needed to trace the dependencies [ms] |\n\nProperties of a dependency:\n\n|  name        |  type      | description                                    |\n|--------------|------------|------------------------------------------------|\n| `id`         | `string`   | module name used in `define()` or `require()`  |\n| `path`       | `string`   | path to the module in the file system          |\n| `deps`       | `string[]` | dependencies of the module (optional)          |\n| `dependents` | `string[]` | dependents of the module (optional)            |\n\n### traceMany(options: object): Promise\\\u003cobject\\\u003e\n\nFinds direct and indirect dependencies for more a RequireJS modules.\n\n```js\nimport { traceMany } from 'requirejs-dependencies'\nconst { traced, time } = await traceMany({\n  modules: ['src/store', 'src/shell'], rootDir: 'src', config: 'src/config.js'\n})\nfor (const { id, path, deps, dependents } of traced['src/store']) { ... }\nfor (const { id, path, deps, dependents } of traced['src/shell']) { ... }\n```\n\nAvailable options:\n\n|  name     |  type      | description                                      |\n|-----------|------------|--------------------------------------------------|\n| `modules` | `string[]` | module names recognized by RequireJS (mandatory) |\n\nOther options are the same as for [`traceSingle`], except for the missing `module`.\n\nPromised result properties:\n\n|  name     |  type    | description                                |\n|-----------|----------|--------------------------------------------|\n| `traced`  | `object` | map of module names and their dependencies |\n| `time`    | `number` | time needed to trace the dependencies [ms] |\n\nThe `traced` object contains input module names as keys and arrays of their dependencies as values. The array of the dependencies is the same as `traced` from the promised properties from [`traceSingle`].\n\n### getUnion (manyModules: object[][] | object{[key: string]: object[]}): object[]\n\nReturns an array of distinct dependencies after dropping duplicates from the input. The input can be either array of arrays of dependencies, or an object, where keys are module names and values arrays of dependencies. A single array of the dependencies is the same as `traced` from the promised properties from [`traceSingle`].\n\n```js\nimport { traceMany } from 'requirejs-dependencies'\nlet { traced, time } = await traceMany({\n  modules: ['src/store', 'src/shell'], rootDir: 'src', config: 'src/config.js'\n})\nfor (const { id, path, deps, dependents } of getUnion(traced)) { ... }\n```\n\n### getIntersection (manyModules: object[][] | object{[key: string]: object[]}): object[]\n\nReturns an array of modles that each input module depends on, directly or indirectly. The input can be either array of arrays of dependencies, or an object, where keys are module names and values arrays of dependencies. A single array of the dependencies is the same as `traced` from the promised properties from [`traceSingle`].\n\n```js\nimport { traceMany } from 'requirejs-dependencies'\nlet { traced, time } = await traceMany({\n  modules: ['src/store', 'src/shell'], rootDir: 'src', config: 'src/config.js'\n})\nfor (const { id, path, dependents } of getIntersection(traced)) { ... }\n```\n\n### implodeBundleDependencies (options: object): object[]\n\nReplaces module names in module dependencies with parent bundle names of the particular modules. Then the dependencies are pruned so that each bundle occurs only once there. An array of the dependencies is the same as `traced` from the promised properties from [`traceSingle`]. The parameter `bundles` is in the same format as the bundle configuration for RequireJS. The parameter `tracedBundle` is necessary if the parameter `traced` is just an array of traced dependencies without information what is the current bundle.\n\nAvailable options:\n\n|  name                  |  type                                        | description                  |\n|------------------------|----------------------------------------------|-----------------------------|\n| `traced`               | `object[] | object{[key: string]: object[]}` | output of `traceSingle` or `traceMany` |\n| `bundles`              | `object{[key: string]: string[]}`            | bundle configuration for RequireJS  |\n| `explodeBundles`       | `string[]` | bundles that should be exploded to modules (optional) |\n| `implodeCurrentBundle` | `boolean`  | hide module dependencies from the same bundle (optional) |\n| `tracedBundle`         | `string`   | parent bundle of plain array of traced modules (optional) |\n\n```js\nimport { traceSingle } from 'requirejs-dependencies'\nlet { traced, config, time } = await traceSingle({\n  module: 'src/store', rootDir: 'src', config: 'src/config.js'\n})\ntraced = implodeBundleDependencies({\n  traced, bundles: config.bundles, tracedBundle: 'src/data'\n})\nfor (const { id, path, dependents } of traced) { ... }\n```\n\n### function loadConfig (path: string): object\n\nReturns the RequiteJS configuration as an object. The configuration is usually set by a `require.config` statement in a separate file. It is not exported from the file. This method extracts it without applying it to global RequireJS.\n\n```js\nimport trace from 'amodro-trace'\nimport { loadConfig } from 'requirejs-dependencies'\nconst config = loadConfig(config)\nconst { traced } = await trace({ id, rootDir }, config)\nfor (const { id } of traced) console.log(id)\n```\n\n### function formatMilliseconds (duration: number): string\n\nFormats a number of milliseconds to a readable duration as a string.\n\n```js\nimport { traceSingle, formatMilliseconds } from 'requirejs-dependencies'\nconst { traced, time } = await traceSingle({\n  module: 'src/main', rootDir: 'src', config: 'src/config.js'\n})\nfor (const { id } of traced) console.log(id)\nconsole.log(`\"src/main\" traced in ${formatMilliseconds(time)}`)\n```\n\n## Command-line\n\n```\n$ requirejs-dependencies -h\n\nPrints direct and indirect dependencies of one or more RequireJS modules.\n\nUsage: requirejs-dependencies [option...] \u003cmodule\u003e...\n\nOptions:\n  -r|--rootdir \u003cpath\u003e       source root directory\n  -c|--config \u003cpath\u003e        configuration file for RequireJS\n  --serve                   start server for interactive module inspection\n  --implode-bundles         print bundles as dependencies instead of modules\n  --explode-bundles \u003clist\u003e  specify bundles which modules will remain listed\n  --implode-current-bundle  do not list dependencies from the same bundle\n  -l|--layout layout        graph layout (dot,neato,fdp,twopi,circo,osage)\n  --emphasize-directs       render direct dependencies with different colour\n  --cluster-directs         cluster direct dependencies together\n  --common                  print only common dependencies for more modules\n  --tree                    print module dependencies as a tree\n  --image \u003cpath\u003e            generate image with dependency graph\n  -V|--version              print version number\n  -h|--help                 print usage instructions\n\nIf you enable the option implode-bundles, you need to include bundles\nin your config, so that relations module \u003c--\u003e bundle can be built.\n\nIf no arguments are provided, usage instructions will be printed out.\nErrors and timing are printed on standard error. Dependencies, usage\ninstructions and version number are printed on standard output.\n\nA non-zero exit code is returned in case of error.\n\nExamples:\n  requirejs-dependencies -r src -c src/config.js src/main\n  requirejs-dependencies -r src --common src/store src/shell\n```\n\n## License\n\nCopyright (c) 2020 Ferdinand Prantl\n\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Frequirejs-dependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantlf%2Frequirejs-dependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Frequirejs-dependencies/lists"}