{"_id":"resolve-workspace-root","_rev":"4524937","name":"resolve-workspace-root","description":"Resolve the workspace root using bun, npm, pnpm, or yarn","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"bycedric","email":"me@bycedric.com"}],"time":{"modified":"2026-04-09T13:17:25.000Z","created":"2024-08-22T15:08:16.155Z","2.0.1":"2026-01-05T12:07:34.574Z","2.0.0":"2024-10-10T14:59:08.127Z","1.0.1":"2024-08-23T07:39:51.808Z","1.0.0":"2024-08-22T15:08:16.155Z"},"users":{},"author":{"name":"Cedric van Putten","email":"me@cedric.dev"},"repository":{"type":"git","url":"git+https://github.com/byCedric/resolve-workspace-root.git"},"versions":{"2.0.1":{"name":"resolve-workspace-root","version":"2.0.1","description":"Resolve the workspace root using bun, npm, pnpm, or yarn","main":"build/index.js","types":"build/index.d.ts","scripts":{"build":"ncc build src/index.ts --out build --minify --no-cache --no-source-map-register && tsc --declaration --emitDeclarationOnly","lint":"eslint . --ext ts","test":"bun test"},"repository":{"type":"git","url":"git+https://github.com/byCedric/resolve-workspace-root.git"},"keywords":["monorepo","workspace","bun","npm","pnpm","yarn"],"author":{"name":"Cedric van Putten","email":"me@cedric.dev"},"license":"MIT","bugs":{"url":"https://github.com/byCedric/resolve-workspace-root/issues"},"homepage":"https://github.com/byCedric/resolve-workspace-root#readme","devDependencies":{"@tsconfig/node20":"^20.1.4","@types/bun":"^1.1.6","@types/js-yaml":"^4.0.9","@types/micromatch":"^4.0.9","@types/node":"^22.5.0","@vercel/ncc":"^0.38.1","eslint":"^8.57.0","eslint-config-universe":"^13.0.0","js-yaml":"^4.1.0","memfs":"^4.11.1","micromatch":"^4.0.7","prettier":"^3.3.3","typescript":"^5.5.4"},"eslintConfig":{"extends":"universe/node","ignorePatterns":["build","node_modules"]},"prettier":{"printWidth":100,"tabWidth":2,"singleQuote":true,"trailingComma":"es5"},"_id":"resolve-workspace-root@2.0.1","gitHead":"72f675ae9ea952e832c63f1138346406b0d8630b","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"shasum":"9cbbf8321ebccaaf0e4ffea5274aa26b611ccd62","size":31755,"noattachment":false,"key":"/resolve-workspace-root/-/resolve-workspace-root-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-workspace-root/download/resolve-workspace-root-2.0.1.tgz"},"_npmUser":{"name":"bycedric","email":"me@bycedric.com"},"directories":{},"maintainers":[{"name":"bycedric","email":"me@bycedric.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/resolve-workspace-root_2.0.1_1767614854372_0.25764440480495576"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-05T12:07:34.574Z","publish_time":1767614854574,"_source_registry_name":"default","_cnpm_publish_time":1767614854574},"2.0.0":{"name":"resolve-workspace-root","version":"2.0.0","description":"Resolve the workspace root using bun, npm, pnpm, or yarn","main":"build/index.js","types":"build/index.d.ts","scripts":{"build":"ncc build src/index.ts --out build --minify --no-cache --no-source-map-register && tsc --declaration --emitDeclarationOnly","lint":"eslint . --ext ts","test":"bun test"},"repository":{"type":"git","url":"git+https://github.com/byCedric/resolve-workspace-root.git"},"keywords":["monorepo","workspace","bun","npm","pnpm","yarn"],"author":{"name":"Cedric van Putten","email":"me@cedric.dev"},"license":"MIT","bugs":{"url":"https://github.com/byCedric/resolve-workspace-root/issues"},"homepage":"https://github.com/byCedric/resolve-workspace-root#readme","devDependencies":{"@tsconfig/node20":"^20.1.4","@types/bun":"^1.1.6","@types/js-yaml":"^4.0.9","@types/micromatch":"^4.0.9","@types/node":"^22.5.0","@vercel/ncc":"^0.38.1","eslint":"^8.57.0","eslint-config-universe":"^13.0.0","js-yaml":"^4.1.0","memfs":"^4.11.1","micromatch":"^4.0.7","prettier":"^3.3.3","typescript":"^5.5.4"},"eslintConfig":{"extends":"universe/node","ignorePatterns":["build","node_modules"]},"prettier":{"printWidth":100,"tabWidth":2,"singleQuote":true,"trailingComma":"es5"},"_id":"resolve-workspace-root@2.0.0","gitHead":"6e77a4b87761c086932de1ac3469e320ef5a6251","_nodeVersion":"20.17.0","_npmVersion":"10.8.3","dist":{"shasum":"a0098daa0067cd0efa6eb525c57c8fb4a61e78f8","size":31790,"noattachment":false,"key":"/resolve-workspace-root/-/resolve-workspace-root-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-workspace-root/download/resolve-workspace-root-2.0.0.tgz"},"_npmUser":{"name":"bycedric","email":"me@bycedric.com"},"directories":{},"maintainers":[{"name":"bycedric","email":"me@bycedric.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-workspace-root_2.0.0_1728572347940_0.6331017856272161"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-10-10T14:59:08.127Z","publish_time":1728572348127,"_source_registry_name":"default","_cnpm_publish_time":1728572348127},"1.0.1":{"name":"resolve-workspace-root","version":"1.0.1","description":"Resolve the workspace root using bun, npm, pnpm, or yarn","main":"build/index.js","types":"build/index.d.ts","scripts":{"build":"ncc build src/index.ts --out build --minify --no-cache --no-source-map-register && tsc --declaration --emitDeclarationOnly","lint":"eslint . --ext ts","test":"bun test"},"repository":{"type":"git","url":"git+https://github.com/byCedric/resolve-workspace-root.git"},"keywords":["monorepo","workspace","bun","npm","pnpm","yarn"],"author":{"name":"Cedric van Putten","email":"me@cedric.dev"},"license":"MIT","bugs":{"url":"https://github.com/byCedric/resolve-workspace-root/issues"},"homepage":"https://github.com/byCedric/resolve-workspace-root#readme","devDependencies":{"@tsconfig/node20":"^20.1.4","@types/bun":"^1.1.6","@types/js-yaml":"^4.0.9","@types/micromatch":"^4.0.9","@types/node":"^22.5.0","@vercel/ncc":"^0.38.1","eslint":"^8.57.0","eslint-config-universe":"^13.0.0","js-yaml":"^4.1.0","memfs":"^4.11.1","micromatch":"^4.0.7","prettier":"^3.3.3","typescript":"^5.5.4"},"eslintConfig":{"extends":"universe/node","ignorePatterns":["build","node_modules"]},"prettier":{"printWidth":100,"tabWidth":2,"singleQuote":true,"trailingComma":"es5"},"_id":"resolve-workspace-root@1.0.1","gitHead":"56c790f94dc25d0a6b32d1c3a1dd98be50171015","_nodeVersion":"20.16.0","_npmVersion":"10.8.2","dist":{"shasum":"b9c9f93b76098ba8722d46cd7dbd1569cba16ff8","size":31588,"noattachment":false,"key":"/resolve-workspace-root/-/resolve-workspace-root-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-workspace-root/download/resolve-workspace-root-1.0.1.tgz"},"_npmUser":{"name":"bycedric","email":"me@bycedric.com"},"directories":{},"maintainers":[{"name":"bycedric","email":"me@bycedric.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-workspace-root_1.0.1_1724398791654_0.45707015543065044"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-08-23T07:39:51.808Z","publish_time":1724398791808,"_source_registry_name":"default","_cnpm_publish_time":1724398791808},"1.0.0":{"name":"resolve-workspace-root","version":"1.0.0","description":"Resolve the workspace root using bun, npm, pnpm, or yarn","main":"build/index.js","types":"build/index.d.ts","scripts":{"build":"ncc build src/index.ts --out build --minify --no-cache --no-source-map-register && tsc --declaration --emitDeclarationOnly","lint":"eslint . --ext ts","test":"bun test"},"repository":{"type":"git","url":"git+https://github.com/byCedric/resolve-workspace-root.git"},"keywords":["monorepo","workspace","bun","npm","pnpm","yarn"],"author":{"name":"Cedric van Putten","email":"me@cedric.dev"},"license":"MIT","bugs":{"url":"https://github.com/byCedric/resolve-workspace-root/issues"},"homepage":"https://github.com/byCedric/resolve-workspace-root#readme","devDependencies":{"@tsconfig/node20":"^20.1.4","@types/bun":"^1.1.6","@types/js-yaml":"^4.0.9","@types/micromatch":"^4.0.9","@types/node":"^22.5.0","@vercel/ncc":"^0.38.1","eslint":"^8.57.0","eslint-config-universe":"^13.0.0","js-yaml":"^4.1.0","memfs":"^4.11.1","micromatch":"^4.0.7","prettier":"^3.3.3","typescript":"^5.5.4"},"eslintConfig":{"extends":"universe/node","ignorePatterns":["build","node_modules"]},"prettier":{"printWidth":100,"tabWidth":2,"singleQuote":true,"trailingComma":"es5"},"_id":"resolve-workspace-root@1.0.0","gitHead":"c38e29738ef602c16d46bcf9d61ad9824ed861f0","_nodeVersion":"20.16.0","_npmVersion":"10.8.2","dist":{"shasum":"c5c0b393e446b6a20bb608d710757635051d6158","size":31557,"noattachment":false,"key":"/resolve-workspace-root/-/resolve-workspace-root-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-workspace-root/download/resolve-workspace-root-1.0.0.tgz"},"_npmUser":{"name":"bycedric","email":"me@bycedric.com"},"directories":{},"maintainers":[{"name":"bycedric","email":"me@bycedric.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-workspace-root_1.0.0_1724339295991_0.6040674454951516"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-08-22T15:08:16.155Z","publish_time":1724339296155,"_source_registry_name":"default","_cnpm_publish_time":1724339296155}},"readme":"# resolve-workspace-root\n\nResolve the root of a workspace using [bun](https://bun.sh/guides/install/workspaces), [npm](https://docs.npmjs.com/cli/configuring-npm/package-json#workspaces), [pnpm](https://pnpm.io/workspaces), or [yarn](https://yarnpkg.com/features/workspaces).\n\n- For bun, npm, and yarn - it looks for a parent **package.json** file, containing the `workspaces` config.\n- For pnpm - it looks for a **package.json** and **pnpm-workspaces.yaml** file, containing the workspaces config.\n\n## ???? How to use it\n\nThis package supports both synchronous and asynchronous lookups.\n\n```ts\nimport { resolveWorkspaceRoot, resolveWorkspaceRootAsync } from 'resolve-workspace-root';\n\n// Synchronous lookup, supporting bun, npm, pnpm, and yarn\nconst workspaceRoot = resolveWorkspaceRoot(__dirname);\n// Synchronous lookup, supporting only bun, npm, and yarn\nconst workspaceRoot = resolveWorkspaceRoot(__dirname, { packageWorkspaces: false });\n// Synchronous lookup, supporting only pnpm\nconst workspaceRoot = resolveWorkspaceRoot(__dirname, { pnpmWorkspaces: false });\n\n// Asynchronous lookup, supporting bun, npm, pnpm, and yarn\nconst workspaceRoot = await resolveWorkspaceRootAsync(__dirname);\n// Asynchronous lookup, supporting only bun, npm, and yarn\nconst workspaceRoot = await resolveWorkspaceRootAsync(__dirname, { packageWorkspaces: false });\n// Asynchronous lookup, supporting only pnpm\nconst workspaceRoot = await resolveWorkspaceRootAsync(__dirname, { pnpmWorkspaces: false });\n\nimport { getWorkspaceGlobs, getWorkspaceGlobsAsync } from 'resolve-workspace-root';\n\n// Synchronous lookup, supporting bun, npm, pnpm, and yarn\nconst workspaces = getWorkspaceGlobs(resolveWorkspaceRoot(__dirname));\n// Asynchronous lookup, supporting bun, npm, pnpm, and yarn\nconst workspaces = await getWorkspaceGlobsAsync(resolveWorkspaceRoot(__dirname));\n```\n\n<div align=\"center\">\n  <br />\n  with&nbsp;❤️&nbsp;&nbsp;<strong><a href=\"https://cedric.dev\">Cedric</a></strong>\n  <br />\n</div>\n","_attachments":{},"homepage":"https://github.com/byCedric/resolve-workspace-root#readme","bugs":{"url":"https://github.com/byCedric/resolve-workspace-root/issues"},"license":"MIT"}