{"id":16528551,"url":"https://github.com/joshuajaco/find-workspaces","last_synced_at":"2025-03-21T09:31:36.408Z","repository":{"id":40476900,"uuid":"419033566","full_name":"joshuajaco/find-workspaces","owner":"joshuajaco","description":"Find all the workspaces of a monorepo.","archived":false,"fork":false,"pushed_at":"2024-08-28T18:25:26.000Z","size":264,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T04:51:12.383Z","etag":null,"topics":["bolt","lerna-monorepo","monorepo","npm-workspaces","pnpm-workspaces","workspaces","yarn-workspaces"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/find-workspaces","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/joshuajaco.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-19T17:50:20.000Z","updated_at":"2024-10-23T12:13:05.000Z","dependencies_parsed_at":"2024-02-16T22:58:28.316Z","dependency_job_id":"c83e9c6d-d1a1-448a-a33c-4a48eb02d0dc","html_url":"https://github.com/joshuajaco/find-workspaces","commit_stats":{"total_commits":36,"total_committers":3,"mean_commits":12.0,"dds":"0.19444444444444442","last_synced_commit":"5b98c7c164dddecde62d46adf61160068e7d6cf3"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuajaco%2Ffind-workspaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuajaco%2Ffind-workspaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuajaco%2Ffind-workspaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuajaco%2Ffind-workspaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshuajaco","download_url":"https://codeload.github.com/joshuajaco/find-workspaces/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130233,"owners_count":20402754,"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":["bolt","lerna-monorepo","monorepo","npm-workspaces","pnpm-workspaces","workspaces","yarn-workspaces"],"created_at":"2024-10-11T17:40:50.075Z","updated_at":"2025-03-21T09:31:36.083Z","avatar_url":"https://github.com/joshuajaco.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# find-workspaces ![npm downloads](https://img.shields.io/npm/dw/find-workspaces) [![Coverage Status](https://coveralls.io/repos/github/joshuajaco/find-workspaces/badge.svg)](https://coveralls.io/github/joshuajaco/find-workspaces) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\nFind all the workspaces of a monorepo.\n\nIt supports:\n\n- [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces)\n- [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces)\n- [pnpm workspaces](https://pnpm.io/workspaces)\n- [lerna](https://github.com/lerna/lerna)\n- [bolt](https://github.com/boltpkg/bolt)\n\n## Installation\n\n```sh\n# npm\nnpm i find-workspaces\n\n# yarn\nyarn add find-workspaces\n\n# pnpm\npnpm add find-workspaces\n```\n\n## Usage\n\n```javascript\n// esm\nimport { findWorkspaces } from \"find-workspaces\";\n// commonjs\nconst { findWorkspaces } = require(\"find-workspaces\");\n\nconst workspaces = findWorkspaces();\n\nconsole.log(workspaces);\n```\n\n## API\n\n### findWorkspaces(dirname, options)\n\nFinds all workspaces.  \nReturns [`Workspace[]`](#workspace) or `null` if `dirname` is not inside a monorepo.\n\n#### dirname\n\nType: `string | undefined`  \nDefault: `process.cwd()`\n\nThe directory to start searching for the monorepo root.\n\n#### Options\n\nType: `Options`  \nDefault: `{}`\n\nSee [`Options`](#options-2)\n\n### findWorkspacesRoot(dirname, options)\n\nFinds the monorepo root.\nReturns [`WorkspacesRoot`](#workspaceroot) or `null` if `dirname` is not inside a monorepo.\n\n#### dirname\n\nType: `string | undefined`  \nDefault: `process.cwd()`\n\nThe directory to start searching for the monorepo root.\n\n#### Options\n\nType: `Options`  \nDefault: `{}`\n\nSee [`Options`](#options-2)\n\n### createWorkspacesCache()\n\nReturns a cache which can be provided to [`findWorkspaces`](#findworkspacesdirname-options) and [`findWorkspacesRoot`](#findworkspacesrootdirname-options).\n\n### Options\n\n#### stopDir\n\nType: `string | undefined`  \nDefault: `os.homedir()`\n\nThe directory to stop searching for the monorepo root.  \nThe provided directory will not be included in the search.\n\n#### cache\n\nType: `Cache | undefined`\n\nAn optional cache created by [`createWorkspacesCache`](#createworkspacescache).\n\n### Workspace\n\n#### location\n\nType: `string`\n\nThe location of the workspace as an absolute path.\n\n#### package\n\nType: [`PackageJson`](https://github.com/sindresorhus/type-fest/blob/main/source/package-json.d.ts)\n\nThe parsed `package.json` file of the workspace.\n\n### WorkspaceRoot\n\n#### location\n\nType: `string`\n\nThe location of the workspace as an absolute path.\n\n#### globs\n\nType: `string[]`\n\nA list of the glob patterns used to define the workspaces.\n\n## License\n\n[MIT](https://github.com/joshuajaco/find-workspaces/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuajaco%2Ffind-workspaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshuajaco%2Ffind-workspaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuajaco%2Ffind-workspaces/lists"}