{"id":18292318,"url":"https://github.com/nexe/resolve-dependencies","last_synced_at":"2025-08-22T09:33:42.913Z","repository":{"id":27783967,"uuid":"108613433","full_name":"nexe/resolve-dependencies","owner":"nexe","description":"Given an entrypoint, get all of the dependencies connected to it.","archived":false,"fork":false,"pushed_at":"2023-07-18T21:54:14.000Z","size":970,"stargazers_count":30,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T03:06:16.878Z","etag":null,"topics":["bundler","depth-first-search","nodejs","static-analysis","tree"],"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/nexe.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}},"created_at":"2017-10-28T02:27:27.000Z","updated_at":"2024-11-08T04:06:19.000Z","dependencies_parsed_at":"2024-01-23T17:44:00.614Z","dependency_job_id":"93044ac5-0bf2-4d1f-95f4-7200d5aa2794","html_url":"https://github.com/nexe/resolve-dependencies","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexe%2Fresolve-dependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexe%2Fresolve-dependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexe%2Fresolve-dependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexe%2Fresolve-dependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nexe","download_url":"https://codeload.github.com/nexe/resolve-dependencies/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247324638,"owners_count":20920687,"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":["bundler","depth-first-search","nodejs","static-analysis","tree"],"created_at":"2024-11-05T14:17:43.042Z","updated_at":"2025-04-05T10:31:14.725Z","avatar_url":"https://github.com/nexe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003eresolve-dependencies\u003c/h2\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\u003ccode\u003enpm i resolve-dependencies\u003c/code\u003e\u003c/p\u003e\n\n`resolve-dependencies` is the very originally named bundler for [nexe](https://github.com/nexe/nexe). It wasn't our intention to build a bundler but that is kind of what this is.\n\n## Exports\n\n\n### `default: resolveSync(options: Options, ...opts: Options[]): Promise\u003cResult\u003e`\n  \n  - `Options`: _Object | string_ -- the entry to start from (if string)\n    - `entries`: _string[]_ -- a list of entrypoints to traverse, resolved against cwd\n    - `cwd`: _string_ -- the base directory that the resolution occurs from\n    - `loadContent`: _boolean_ -- indicates that the content should be included int he FileMap (this may be unreasonable for large dependency trees)\n    - `files`: _({ [key: string]: File | null })[]_ -- a cache of already resolved files\n    - `expand`: _'all' | 'none' | 'variable'_ -- how module contexts should be expanded to include extra files\n\nAll options are deeply merged, string options are added as `entries`\n\nResult returns a Promise of a result object:\n  - `Result`: _Object_\n    - `entries`: _{ [key: entry]: File }_ - all the entries as provided to the `resolve` method and the tree of connected `files`\n    - `files`: _{ [key: absPath]: File }_ - all resolved files keyed by their absolute path\n    - `warnings`: _string[]_ - an array warnings generated while processing the `files`\n\nA `File` has the following shape\n  - `File`: _Object_ -- An object representing a file\n    - `size`: _number_ -- file size of the link or file\n    - `absPath`: _string_ -- absolute path to the file\n    - `moduleRoot`: _string | undefined_ -- Directory containing a modules package.json\n    - `package`: _any | undefined_\n    - `deps`: _{ [key: request]: File | null }_ -- Dependencies identified in the file, keyed by request\n    - `belongsTo`: _File | undefined_ -- The main file of the owning module\n    - `realSize`: _number | undefined_ -- set to the realfile size if the absPath is a symlink\n    - `realPath`: _string | undefined_ -- set to the realpath if the absPath is a symlink\n    - `contents`: _string | null_\n    - `contextExpanded`: _boolean_\n    - `variableImports`: _boolean_\n\n\n## Example:\n\n```javascript\nimport resolveDependencies from 'resolve-dependencies'\n\nconst { entries, files } = resolveDependencies('./entry-file.js')\nconsole.log(entries['./entry-file.js'])\n\n// {\n//   absPath: \"/path/to/entry-file.js\",\n//   contents: \"console.log('hello world')\",\n//   realSize: 26,\n//   realPath: \"/path/to/entry/lib/file.js\"\n//   size: 12\n//   variableImports: false,\n//   deps: {\n//     \"./dependency\": {\n//       absPath: \"/path/to/dependency.js\"\n//       ...\n//     },\n//     path: null, //node builtin does not resolve\n//     mkdirp: {\n//       absPath: \"/path/to/node_modules/mkdirp/index.js\",\n//       modulePath: \"/path/to/node_modules/mkdirp\",\n//       package: {\n//         name: \"mkdirp\"\n//         ...\n//       }\n//     }\n//   }\n// }\n//  `files` is a similar structure to entries, but \n//   is flat and keyed by the file's absolute path.\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexe%2Fresolve-dependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexe%2Fresolve-dependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexe%2Fresolve-dependencies/lists"}