{"name":"@npmcli/map-workspaces","version":"3.0.4","keywords":["npm","npmcli","libnpm","cli","workspaces","map-workspaces"],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"@npmcli/map-workspaces@3.0.4","maintainers":[{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"fritzy","email":"fritzy@github.com"},{"name":"nlf","email":"quitlahok@gmail.com"},{"name":"gar","email":"gar+npm@danger.computer"},{"name":"lukekarrys","email":"luke@lukekarrys.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":"15ad7d854292e484f7ba04bc30187a8320dba799","tarball":"http://registry-npm.ywwl.com/@npmcli/map-workspaces/download/@npmcli/map-workspaces-3.0.4.tgz","fileCount":4,"integrity":"sha512-Z0TbvXkRbacjFFLpVpV0e2mheCh+WzQpcqL+4xp49uNJOxOnIAPZyXtUxZ5Qn3QBTGKA11Exjd9a5411rBrhDg==","signatures":[{"sig":"MEYCIQCxwkiOW5cHhAAvsYW1CaZOgSowCdemWwIC31ndQq0FJAIhALUbhGHfHzQxtugI8UCXpQyd2xip8V74CL1yYLAKrNA+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@npmcli%2fmap-workspaces@3.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":9754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSscKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpK/w/+MVXV5LS8gRrmBKdYhsiAJw8mKCNOIPYkviNMTgmDb/aaB57k\r\nTCnAoWZAJbbd+5V1BkmHQBHWy8A64ZKfC2uxr020KG5TjxTkp5FbhOFem8KN\r\nCANBDn7PAFICd1372dj5yjP9PTvYAcah4yb1nsJpDm7PCpK+d42Br8WAjsz4\r\n/VNozKtcSM9o3hBX1z+MtmYr479EeCCUVk5OXnBhXIT0E+dgRq22fIu3Xr09\r\nCfu/IGzZNFOwaVkHvJWHrVf4SDqT/uiPyPGmDJ1uWYyJrhS9goGxIP9Tu9VP\r\n018nxb1BupqgpvWIJxM4Lb6z0pDpCY18Icaam9uXIzSsZg+RaETxDb4sWLlI\r\nL2KNE2WYb3GeSkD0up/z2JvzA3Rh5zm/KblvdlO2MOLvgXovhouDAF0rZ62i\r\nMzXS9w3j85FclIVx3sXaO70BuB+ejYCYhw+gsfsmGz+73Q0kK6SIkIZrhvIj\r\ncJtbFAH2M9nduoalca9WePjKLqx0UqBMtYX81PJSfJpGgghn5Vv5NiggwnOL\r\nBNdNdDezRwQvIpKWmnH9GonJA/P0WfQTdxbiHTTu/I6jJQouNDlV5DedOJ0V\r\n5RAf4RamTboP2/eQfRgqJpXS04YPHmWvm8czlosSgKic6IKj4Wwb5srdAS9Y\r\nMwmOufzyoksJSLcxIXvPjuidSUrPovKAjrY=\r\n=CLb4\r\n-----END PGP SIGNATURE-----\r\n","size":3736,"noattachment":false,"key":"/@npmcli/map-workspaces/-/@npmcli/map-workspaces-3.0.4.tgz"},"main":"lib/index.js","engines":{"node":"^14.17.0 || ^16.13.0 || >=18.0.0"},"gitHead":"cc0580d8e8486816eb8dea8efe01e3734605a996","scripts":{"lint":"eslint \"**/*.js\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","pretest":"npm run lint","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},"repository":{"url":"git+https://github.com/npm/map-workspaces.git","type":"git"},"_npmVersion":"9.6.5","description":"Retrieves a name:pathname Map for a given workspaces config","directories":{},"templateOSS":{"publish":"true","version":"4.14.1","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"18.16.0","dependencies":{"glob":"^10.2.2","minimatch":"^9.0.0","read-package-json-fast":"^3.0.0","@npmcli/name-from-folder":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.1","@npmcli/template-oss":"4.14.1","@npmcli/eslint-config":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/map-workspaces_3.0.4_1682622218032_0.5168634417610212","host":"s3://npm-registry-packages"},"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":1682622218181,"_cnpm_publish_time":1682622218181,"dist-tags":{"latest":"6.0.0"}}