{"name":"libnpmteam","version":"8.0.2","author":{"name":"GitHub Inc."},"license":"ISC","_id":"libnpmteam@8.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://npmjs.com/package/libnpmteam","bugs":{"url":"https://github.com/npm/cli/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"0417161bfcd155f5e8391cc2b6a05260ccbf1f41","tarball":"http://registry-npm.ywwl.com/libnpmteam/download/libnpmteam-8.0.2.tgz","fileCount":4,"integrity":"sha512-ypLrDUQoi8EhG+gzx5ENMcYq23YjPV17Mfvx4nOnQiHOi8vp47+4GvZBrMsEM4yeHPwxguF/HZoXH4rJfHdH/w==","signatures":[{"sig":"MEQCIAEQlyHVazTefc0LNKWLVLL9oUFQZwYnxHhlcKKSQUHTAiBwSzUSeVWcK9gfWRlyKY/yw1SX6TRVzcttJmAdyyxSHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8653,"size":3164,"noattachment":false,"key":"/libnpmteam/-/libnpmteam-8.0.2.tgz"},"main":"lib/index.js","engines":{"node":"^20.17.0 || >=22.9.0"},"gitHead":"786ec4139c5f278f708765a0a7fd33a987ac0acb","scripts":{"lint":"npm run eslint","snap":"tap","test":"tap","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","lintfix":"npm run eslint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"owlstronaut","email":"owlstronaut@github.com"},"repository":{"url":"git+https://github.com/npm/cli.git","type":"git","directory":"workspaces/libnpmteam"},"_npmVersion":"11.6.1","description":"npm Team management APIs","directories":{},"templateOSS":{"content":"../../scripts/template-oss/index.js","version":"4.25.1","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"23.11.0","dependencies":{"aproba":"^2.0.0","npm-registry-fetch":"^19.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.8","nock":"^13.3.3","@npmcli/template-oss":"4.25.1","@npmcli/eslint-config":"^5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/libnpmteam_8.0.2_1758740406987_0.8404325766771117","host":"s3://npm-registry-packages-npm-production"},"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## 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### 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### 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":1758740407218,"_cnpm_publish_time":1758740407218,"dist-tags":{"backport":"5.0.4","latest":"9.0.0","prerelease":"9.0.0-pre.0"}}