{"name":"libnpmteam","version":"6.0.3","author":{"name":"GitHub Inc."},"license":"ISC","_id":"libnpmteam@6.0.3","maintainers":[{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"fritzy","email":"fritzy@github.com"},{"name":"gar","email":"gar+npm@danger.computer"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"homepage":"https://npmjs.com/package/libnpmteam","bugs":{"url":"https://github.com/npm/cli/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"54a70c51cf69bb015a84a4cbb6d57f3a81b484b7","tarball":"http://registry-npm.ywwl.com/libnpmteam/download/libnpmteam-6.0.3.tgz","fileCount":4,"integrity":"sha512-ZO4j+mGfoSH2IEwsf2DqrLaEduAJ725eb6KuJ6+OIWpsXY+FRgan0EWBeBrahmzhJt5jTwsV466LqX7e+YHkQQ==","signatures":[{"sig":"MEQCIB8jDqkQagOeedtJqD0DiW7RSU1WyEpIZnzd5s+odNYqAiAxlPSJQSKX1TIq1LMK+uk9Bv4SA3n8Fs9ZxIbgJFObVA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9085,"size":3367,"noattachment":false,"key":"/libnpmteam/-/libnpmteam-6.0.3.tgz"},"main":"lib/index.js","engines":{"node":"^16.14.0 || >=18.0.0"},"scripts":{"lint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"gar","email":"gar+npm@danger.computer"},"repository":{"url":"git+https://github.com/npm/cli.git","type":"git","directory":"workspaces/libnpmteam"},"_npmVersion":"10.6.0","description":"npm Team management APIs","directories":{},"templateOSS":{"content":"../../scripts/template-oss/index.js","version":"4.21.3","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"20.12.2","dependencies":{"aproba":"^2.0.0","npm-registry-fetch":"^16.2.1"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.8","nock":"^13.3.3","@npmcli/template-oss":"4.21.3","@npmcli/eslint-config":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/libnpmteam_6.0.3_1714066064473_0.36829942307994235","host":"s3://npm-registry-packages"},"readme":"# libnpmteam\n\n[![npm version](https://img.shields.io/npm/v/libnpmteam.svg)](https://npm.im/libnpmteam)\n[![license](https://img.shields.io/npm/l/libnpmteam.svg)](https://npm.im/libnpmteam)\n[![CI - libnpmteam](https://github.com/npm/cli/actions/workflows/ci-libnpmteam.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmteam.yml)\n\n[`libnpmteam`](https://github.com/npm/libnpmteam) is a Node.js\nlibrary that provides programmatic access to the guts of the npm CLI's `npm\nteam` command and its various subcommands.\n\n## Example\n\n```javascript\nconst team = require('libnpmteam')\n\n// List all teams for the @npm org.\nconsole.log(await team.lsTeams('npm'))\n```\n\n## Publishing\n1. Manually create CHANGELOG.md file\n1. Commit changes to CHANGELOG.md\n    ```bash\n    $ git commit -m \"chore: updated CHANGELOG.md\"\n    ```\n1. Run `npm version {newVersion}`\n    ```bash\n    # Example\n    $ npm version patch\n    # 1. Runs `coverage` and `lint` scripts\n    # 2. Bumps package version; and **create commit/tag**\n    # 3. Runs `npm publish`; publishing directory with **unpushed commit**\n    # 4. Runs `git push origin --follow-tags`\n    ```\n\n## Table of Contents\n\n* [Installing](#install)\n* [Example](#example)\n* [API](#api)\n  * [team opts](#opts)\n  * [`create()`](#create)\n  * [`destroy()`](#destroy)\n  * [`add()`](#add)\n  * [`rm()`](#rm)\n  * [`lsTeams()`](#ls-teams)\n  * [`lsTeams.stream()`](#ls-teams-stream)\n  * [`lsUsers()`](#ls-users)\n  * [`lsUsers.stream()`](#ls-users-stream)\n\n### Install\n\n`$ npm install libnpmteam`\n\n### API\n\n#### <a name=\"opts\"></a> `opts` for `libnpmteam` commands\n\n`libnpmteam` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch).\nAll options are passed through directly to that library, so please refer to [its\nown `opts`\ndocumentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options)\nfor options that can be passed in.\n\nA couple of options of note for those in a hurry:\n\n* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs.\n* `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmteam` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}`\n\n#### <a name=\"create\"></a> `> team.create(team, [opts]) -> Promise`\n\nCreates a team named `team`. Team names use the format `@<scope>:<name>`, with\nthe `@` being optional.\n\nAdditionally, `opts.description` may be passed in to include a description.\n\n##### Example\n\n```javascript\nawait team.create('@npm:cli', {token: 'myregistrytoken'})\n// The @npm:cli team now exists.\n```\n\n#### <a name=\"destroy\"></a> `> team.destroy(team, [opts]) -> Promise`\n\nDestroys a team named `team`. Team names use the format `@<scope>:<name>`, with\nthe `@` being optional.\n\n##### Example\n\n```javascript\nawait team.destroy('@npm:cli', {token: 'myregistrytoken'})\n// The @npm:cli team has been destroyed.\n```\n\n#### <a name=\"add\"></a> `> team.add(user, team, [opts]) -> Promise`\n\nAdds `user` to `team`.\n\n##### Example\n\n```javascript\nawait team.add('zkat', '@npm:cli', {token: 'myregistrytoken'})\n// @zkat now belongs to the @npm:cli team.\n```\n\n#### <a name=\"rm\"></a> `> team.rm(user, team, [opts]) -> Promise`\n\nRemoves `user` from `team`.\n\n##### Example\n\n```javascript\nawait team.rm('zkat', '@npm:cli', {token: 'myregistrytoken'})\n// @zkat is no longer part of the @npm:cli team.\n```\n\n#### <a name=\"ls-teams\"></a> `> team.lsTeams(scope, [opts]) -> Promise`\n\nResolves to an array of team names belonging to `scope`.\n\n##### Example\n\n```javascript\nawait team.lsTeams('@npm', {token: 'myregistrytoken'})\n=>\n[\n  'npm:cli',\n  'npm:web',\n  'npm:registry',\n  'npm:developers'\n]\n```\n\n#### <a name=\"ls-teams-stream\"></a> `> team.lsTeams.stream(scope, [opts]) -> Stream`\n\nReturns a stream of teams belonging to `scope`.\n\nFor a Promise-based version of these results, see [`team.lsTeams()`](#ls-teams).\n\n##### Example\n\n```javascript\nfor await (let team of team.lsTeams.stream('@npm', {token: 'myregistrytoken'})) {\n  console.log(team)\n}\n\n// outputs\n// npm:cli\n// npm:web\n// npm:registry\n// npm:developers\n```\n\n#### <a name=\"ls-users\"></a> `> team.lsUsers(team, [opts]) -> Promise`\n\nResolves to an array of usernames belonging to `team`.\n\nFor a streamed version of these results, see [`team.lsUsers.stream()`](#ls-users-stream).\n\n##### Example\n\n```javascript\nawait team.lsUsers('@npm:cli', {token: 'myregistrytoken'})\n=>\n[\n  'iarna',\n  'zkat'\n]\n```\n\n#### <a name=\"ls-users-stream\"></a> `> team.lsUsers.stream(team, [opts]) -> Stream`\n\nReturns a stream of usernames belonging to `team`.\n\nFor a Promise-based version of these results, see [`team.lsUsers()`](#ls-users).\n\n##### Example\n\n```javascript\nfor await (let user of team.lsUsers.stream('@npm:cli', {token: 'myregistrytoken'})) {\n  console.log(user)\n}\n\n// outputs\n// iarna\n// zkat\n```\n","publish_time":1714066064643,"_cnpm_publish_time":1714066064643,"dist-tags":{"backport":"5.0.4","latest":"9.0.0","prerelease":"9.0.0-pre.0"}}