{"name":"@npmcli/map-workspaces","version":"5.0.2","keywords":["npm","npmcli","libnpm","cli","workspaces","map-workspaces"],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"@npmcli/map-workspaces@5.0.2","maintainers":[{"name":"gar","email":"gar+npm@danger.computer"},{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},{"name":"reggi","email":"reggi@github.com"},{"name":"hashtagchris","email":"hashtagchris@github.com"},{"name":"owlstronaut","email":"owlstronaut@github.com"}],"homepage":"https://github.com/npm/map-workspaces#readme","bugs":{"url":"https://github.com/npm/map-workspaces/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"],"check-coverage":true},"dist":{"shasum":"4ac1de07d20dd3017a0da16dbefbb17315de2d0a","tarball":"http://registry-npm.ywwl.com/@npmcli/map-workspaces/download/@npmcli/map-workspaces-5.0.2.tgz","fileCount":4,"integrity":"sha512-Qg508s4CTD4FQxBJyvmRkf9t0s1MaaV09zo3VBg6JT7XIWZlzhcvgB/hzwS0OFRYQUgup5Ovoxb7evTW0kdnpA==","signatures":[{"sig":"MEQCIB43gQc3wBiStgbtVXzpY+nqSyfEAynOQsY383hUbEAJAiAIoWudLHOg3xhSTh61exjNlDV+hOHZgqgAKEnLDJgenQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@npmcli%2fmap-workspaces@5.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10967,"size":4193,"noattachment":false,"key":"/@npmcli/map-workspaces/-/@npmcli/map-workspaces-5.0.2.tgz"},"main":"lib/index.js","engines":{"node":"^20.17.0 || >=22.9.0"},"gitHead":"4f643c72f9a4a3b952beccfa5eb02a27cfa7c3c2","scripts":{"lint":"npm run eslint","snap":"tap","test":"tap","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","lintfix":"npm run eslint -- --fix","pretest":"npm run lint","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:85a9d215-e7ca-49c4-b402-5ff75acd48b6"}},"repository":{"url":"git+https://github.com/npm/map-workspaces.git","type":"git"},"_npmVersion":"11.6.2","description":"Retrieves a name:pathname Map for a given workspaces config","directories":{},"templateOSS":{"publish":"true","version":"4.28.0","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"22.21.1","dependencies":{"glob":"^12.0.0","minimatch":"^10.0.3","@npmcli/package-json":"^7.0.0","@npmcli/name-from-folder":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.1","@npmcli/template-oss":"4.28.0","@npmcli/eslint-config":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/map-workspaces_5.0.2_1763506284502_0.2787546055585497","host":"s3://npm-registry-packages-npm-production"},"readme":"# @npmcli/map-workspaces\n\n[![NPM version](https://img.shields.io/npm/v/@npmcli/map-workspaces)](https://www.npmjs.com/package/@npmcli/map-workspaces)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/npm/map-workspaces/ci.yml?branch=main)](https://github.com/npm/map-workspaces)\n[![License](https://img.shields.io/npm/l/@npmcli/map-workspaces)](https://github.com/npm/map-workspaces/blob/main/LICENSE.md)\n\nRetrieves a name:pathname Map for a given workspaces config.\n\nLong version: Reads the `workspaces` property from a valid **workspaces configuration** object and traverses the paths and globs defined there in order to find valid nested packages and return a **Map** of all found packages where keys are package names and values are folder locations.\n\n## Install\n\n`npm install @npmcli/map-workspaces`\n\n## Usage:\n\n```js\nconst mapWorkspaces = require('@npmcli/map-workspaces')\nawait mapWorkspaces({\n  cwd,\n  pkg: {\n    workspaces: {\n      packages: [\n        \"a\",\n        \"b\"\n      ]\n    }\n  }\n})\n// ->\n// Map {\n//   'a': '<cwd>/a'\n//   'b': '<cwd>/b'\n// }\n```\n\n## Examples:\n\n### Glob usage:\n\nGiven a folder structure such as:\n\n```\n├── package.json\n└── apps\n   ├── a\n   │   └── package.json\n   ├── b\n   │   └── package.json\n   └── c\n       └── package.json\n```\n\n```js\nconst mapWorkspaces = require('@npmcli/map-workspaces')\nawait mapWorkspaces({\n  cwd,\n  pkg: {\n    workspaces: [\n      \"apps/*\"\n    ]\n  }\n})\n// ->\n// Map {\n//   'a': '<cwd>/apps/a'\n//   'b': '<cwd>/apps/b'\n//   'c': '<cwd>/apps/c'\n// }\n```\n\n## API:\n\n### `mapWorkspaces(opts) -> Promise<Map>`\n\n- `opts`:\n  - `pkg`: A valid `package.json` **Object**\n  - `cwd`: A **String** defining the base directory to use when reading globs and paths.\n  - `ignore`: An **Array** of paths to be ignored when using [globs](https://www.npmjs.com/package/glob) to look for nested package.\n  - ...[Also support all other glob options](https://www.npmjs.com/package/glob#options)\n\n#### Returns\n\nA **Map** in which keys are **package names** and values are the **pathnames** for each found **workspace**.\n\n## LICENSE\n\n[ISC](./LICENSE)\n\n","publish_time":1763506284699,"_cnpm_publish_time":1763506284699,"dist-tags":{"latest":"6.0.0"}}