{"id":15870141,"url":"https://github.com/beyondkmp/nodemodulecollector","last_synced_at":"2026-02-23T23:11:01.798Z","repository":{"id":257809368,"uuid":"863821949","full_name":"beyondkmp/NodeModuleCollector","owner":"beyondkmp","description":"This is a simple tool to collect all production node modules used in a project","archived":false,"fork":false,"pushed_at":"2024-10-05T03:00:51.000Z","size":2685,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T23:11:12.239Z","etag":null,"topics":["asar","electron-builder","npm","pnpm","yarn"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beyondkmp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2024-09-27T01:26:08.000Z","updated_at":"2025-03-05T19:01:38.000Z","dependencies_parsed_at":"2024-10-04T10:55:43.478Z","dependency_job_id":"39c9b7e3-05ed-4283-b645-f564455d187c","html_url":"https://github.com/beyondkmp/NodeModuleCollector","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":"0.26086956521739135","last_synced_commit":"6ebb62af81d240c06919a6af99f56a46aed16006"},"previous_names":["beyondkmp/nodemodulecollector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondkmp%2FNodeModuleCollector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondkmp%2FNodeModuleCollector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondkmp%2FNodeModuleCollector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondkmp%2FNodeModuleCollector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beyondkmp","download_url":"https://codeload.github.com/beyondkmp/NodeModuleCollector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822312,"owners_count":20353496,"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":["asar","electron-builder","npm","pnpm","yarn"],"created_at":"2024-10-06T00:04:33.267Z","updated_at":"2026-02-23T23:10:58.975Z","avatar_url":"https://github.com/beyondkmp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-module-collector   \r\n\r\nThis is a simple tool to collect all production node modules used in a project. It supports npm, yarn1, pnpm and yarn berry(with node-modules).\r\n\r\nIt is useful to collect all production node modules for a electron project, so that you can easily to package them into electron asar.\r\n\r\n## Design\r\n\r\n1. Get node modules tree from \"npm list\"(npm \u0026 yarn) or \"pnpm list\"\r\n2. Transform the tree to dependency graph\r\n3. Transform the graph to hoisted tree\r\n4. Hoisted tree to node modules array\r\n\r\n## Usage\r\n\r\n```shell\r\nimport { getNodeModules } from 'node-module-collector'\r\nconst result = await getNodeModules(rootDir)\r\n```\r\n\r\nresult is node modules array, like:\r\n\r\n```json\r\n[\r\n  {\r\n    \"name\": \"foo\",\r\n    \"version\": \"1.0.0\",\r\n    \"dir\": \"/path/fixtures/yarn-workspace-demo/node_modules/foo\",\r\n    \"dependencies\": [\r\n      {\r\n        \"name\": \"ms\",\r\n        \"version\": \"2.0.0\",\r\n        \"dir\": \"/path/fixtures/yarn-workspace-demo/node_modules/ms\"\r\n      }\r\n    ]\r\n  },\r\n  {\r\n    \"name\": \"ms\",\r\n    \"version\": \"2.1.1\",\r\n    \"dir\": \"/path/fixtures/yarn-workspace-demo/packages/test-app/node_modules/ms\"\r\n  }\r\n]\r\n```\r\n\r\n## Support\r\n\r\n- [x] npm\r\n- [x] pnpm\r\n- [x] pnpm with hosited\r\n- [x] yarn1\r\n- [x] yarn berry(with node-modules)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondkmp%2Fnodemodulecollector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeyondkmp%2Fnodemodulecollector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondkmp%2Fnodemodulecollector/lists"}