{"name":"libnpmorg","version":"8.0.0","keywords":["libnpm","npm","package manager","api","orgs","teams"],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"libnpmorg@8.0.0","maintainers":[{"name":"fritzy","email":"fritzy@github.com"},{"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"}],"homepage":"https://npmjs.com/package/libnpmorg","bugs":{"url":"https://github.com/npm/libnpmorg/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"e133658149f7e70f5536511a8501ad9348559c2e","tarball":"http://registry-npm.ywwl.com/libnpmorg/download/libnpmorg-8.0.0.tgz","fileCount":4,"integrity":"sha512-VO/mxds3Qu67S7/3TsFbykN+7kzpes14P/RiO3ECtLtUYQdlE5ddXGArRgU2tP4hUHZRvyBhc4sSiAXEzTA4eQ==","signatures":[{"sig":"MEUCIQDg0h91/6ZuBGk6OlyrebjjPrB1IFkwgXX66fOPNo2ktAIgOoA40Kptq4pdYtM4qFNGS3s7gZZzb3KFSSqtci7H6rA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8019,"size":3240,"noattachment":false,"key":"/libnpmorg/-/libnpmorg-8.0.0.tgz"},"main":"lib/index.js","engines":{"node":"^20.17.0 || >=22.9.0"},"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":"gar","email":"gar+npm@danger.computer"},"repository":{"url":"git+https://github.com/npm/cli.git","type":"git","directory":"workspaces/libnpmorg"},"_npmVersion":"11.0.0","description":"Programmatic api for `npm org` commands","directories":{},"templateOSS":{"content":"../../scripts/template-oss/index.js","version":"4.23.6","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"22.12.0","dependencies":{"aproba":"^2.0.0","npm-registry-fetch":"^18.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.8","nock":"^13.3.3","minipass":"^7.1.1","@npmcli/template-oss":"4.23.6","@npmcli/eslint-config":"^5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/libnpmorg_8.0.0_1734369131847_0.13287043055149095","host":"s3://npm-registry-packages-npm-production"},"readme":"# libnpmorg\n\n[![npm version](https://img.shields.io/npm/v/libnpmorg.svg)](https://npm.im/libnpmorg)\n[![license](https://img.shields.io/npm/l/libnpmorg.svg)](https://npm.im/libnpmorg)\n[![CI - libnpmorg](https://github.com/npm/cli/actions/workflows/ci-libnpmorg.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmorg.yml)\n\n[`libnpmorg`](https://github.com/npm/libnpmorg) is a Node.js library for\nprogrammatically accessing the [npm Org membership\nAPI](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#membership-detail).\n\n## Table of Contents\n\n* [Example](#example)\n* [Install](#install)\n* [Contributing](#contributing)\n* [API](#api)\n  * [hook opts](#opts)\n  * [`set()`](#set)\n  * [`rm()`](#rm)\n  * [`ls()`](#ls)\n  * [`ls.stream()`](#ls-stream)\n\n## Example\n\n```js\nconst org = require('libnpmorg')\n\nconsole.log(await org.ls('myorg', {token: 'deadbeef'}))\n=>\nRoster {\n  zkat: 'developer',\n  iarna: 'admin',\n  isaacs: 'owner'\n}\n```\n\n## Install\n\n`$ npm install libnpmorg`\n\n### API\n\n#### <a name=\"opts\"></a> `opts` for `libnpmorg` commands\n\n`libnpmorg` 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 `libnpmorg` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}`\n\n#### <a name=\"set\"></a> `> org.set(org, user, [role], [opts]) -> Promise`\n\nThe returned Promise resolves to a [Membership\nDetail](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#membership-detail)\nobject.\n\nThe `role` is optional and should be one of `admin`, `owner`, or `developer`.\n`developer` is the default if no `role` is provided.\n\n`org` and `user` must be scope names for the org name and user name\nrespectively. They can optionally be prefixed with `@`.\n\nSee also: [`PUT\n/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-membership-replace)\n\n##### Example\n\n```javascript\nawait org.set('@myorg', '@myuser', 'admin', {token: 'deadbeef'})\n=>\nMembershipDetail {\n  org: {\n    name: 'myorg',\n    size: 15\n  },\n  user: 'myuser',\n  role: 'admin'\n}\n```\n\n#### <a name=\"rm\"></a> `> org.rm(org, user, [opts]) -> Promise`\n\nThe Promise resolves to `null` on success.\n\n`org` and `user` must be scope names for the org name and user name\nrespectively. They can optionally be prefixed with `@`.\n\nSee also: [`DELETE\n/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-membership-delete)\n\n##### Example\n\n```javascript\nawait org.rm('myorg', 'myuser', {token: 'deadbeef'})\n```\n\n#### <a name=\"ls\"></a> `> org.ls(org, [opts]) -> Promise`\n\nThe Promise resolves to a\n[Roster](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#roster)\nobject.\n\n`org` must be a scope name for an org, and can be optionally prefixed with `@`.\n\nSee also: [`GET\n/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-roster)\n\n##### Example\n\n```javascript\nawait org.ls('myorg', {token: 'deadbeef'})\n=>\nRoster {\n  zkat: 'developer',\n  iarna: 'admin',\n  isaacs: 'owner'\n}\n```\n\n#### <a name=\"ls-stream\"></a> `> org.ls.stream(org, [opts]) -> Stream`\n\nReturns a stream of entries for a\n[Roster](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#roster),\nwith each emitted entry in `[key, value]` format.\n\n`org` must be a scope name for an org, and can be optionally prefixed with `@`.\n\nThe returned stream is a valid `Symbol.asyncIterator`.\n\nSee also: [`GET\n/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-roster)\n\n##### Example\n\n```javascript\nfor await (let [user, role] of org.ls.stream('myorg', {token: 'deadbeef'})) {\n  console.log(`user: ${user} (${role})`)\n}\n=>\nuser: zkat (developer)\nuser: iarna (admin)\nuser: isaacs (owner)\n```\n","publish_time":1734369132011,"_cnpm_publish_time":1734369132011,"dist-tags":{"backport":"5.0.5","latest":"9.0.0","prerelease":"9.0.0-pre.0"}}