{"name":"libnpmorg","version":"5.0.1","keywords":["libnpm","npm","package manager","api","orgs","teams"],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"libnpmorg@5.0.1","maintainers":[{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"fritzy","email":"fritzy@github.com"},{"name":"darcyclarke","email":"darcy@darcyclarke.me"},{"name":"nlf","email":"quitlahok@gmail.com"},{"name":"gar","email":"gar+npm@danger.computer"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"homepage":"https://npmjs.com/package/libnpmorg","bugs":{"url":"https://github.com/npm/libnpmorg/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"2b3d687f5aec83f42ade94c37f76d18fe94e127b","tarball":"http://registry-npm.ywwl.com/libnpmorg/download/libnpmorg-5.0.1.tgz","fileCount":4,"integrity":"sha512-yTsbTJ6Gl15XV7uLaLSs64fvNd/D0K6w/oghUjuhuKYUydZXEBxsTAeAegwoPxlxwHBHmlgu478KTbw0LbKHvQ==","signatures":[{"sig":"MEYCIQDTAwlPSNQlAQwa0FhS9G4067wNeNuutYjxV2GCzSzf1AIhANajjn35TkYVYuj6/9dP35dzg8vICiMUY9B/Hk0H3rH7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7974,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkR2aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeaQ//a5sRGEIljSC678TDUBWYcdOgjYqnlXevRcN/AHMXtN2t9z6n\r\nS722mqPVS7rJ8ZIwdpLTEFfwz7dUpE5jwzsQY6b13UDUA6nD9LAxKdsb3+Yc\r\nmzjZSKrxHf0DdhodBZeVaip+uoqd2s2Wb3J12UnVXWzC/pUMCjWcnxygEeFk\r\njyvNuyVsG6zrzXH2qJ6Ug6dZNxf21AFZEOp0cejngCG0IPJsYw6Tr9ldQo/x\r\nnb0Nqnbo67VtOdRRoe51f3xYPOa8/fm42ICVVplZZb/AtoqSxKUNpIUqZQH0\r\n9DikQmfrRK4quMEU/0TTa/0cxFg0lTirt7Nk4fqb9NL1kAuXfguyv7cN9RHf\r\nvDlKdRor/ZSwkNAF0/NfHBpecfvnz+hk6cQ6eS6Jt7RpD4M/M2HetDDHrmqb\r\nIYa+bZ9E1yEmKCo922dJTHP1cWuB+HgHNDQg3BEh2ChPYD+8GnZCT10RmIVO\r\nU09rCeR5oGXwtzijLg7Vu0y8Md3PM2l4bJfRpksXjBG5Xjgb8KpeGE2aadcz\r\nZD+Y+wdCRMgOv99AEjcQUIQ1vHVG6uD7ZHJlZWm7OMlc+UZYZLJvA5fhYRrQ\r\nGlnpyatBnXrvqtqJg7hKiRj6WQITkrhXvhziKjV6Z3mDV1khSPzzafdR3GI1\r\n4VkX9cl0w+X1NMVX0wtD1dXbSEmt8lgSHpw=\r\n=jjxU\r\n-----END PGP SIGNATURE-----\r\n","size":3169,"noattachment":false,"key":"/libnpmorg/-/libnpmorg-5.0.1.tgz"},"main":"lib/index.js","engines":{"node":"^14.17.0 || ^16.13.0 || >=18.0.0"},"gitHead":"1ceed7b6a762214904ff4a4a08e364153fd1e1dc","scripts":{"lint":"eslint \"**/*.js\"","snap":"tap","test":"tap","lintfix":"node ../.. run lint -- --fix","postlint":"template-oss-check","posttest":"node ../.. run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"lukekarrys","email":"luke@lukekarrys.com"},"repository":{"url":"git+https://github.com/npm/cli.git","type":"git","directory":"workspaces/libnpmorg"},"_npmVersion":"9.2.0","description":"Programmatic api for `npm org` commands","directories":{},"templateOSS":{"content":"../../scripts/template-oss/index.js","version":"4.11.0","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"18.12.1","dependencies":{"aproba":"^2.0.0","npm-registry-fetch":"^14.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.1","nock":"^13.2.4","minipass":"^4.0.0","@npmcli/template-oss":"4.11.0","@npmcli/eslint-config":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/libnpmorg_5.0.1_1670454682714_0.4345388825378369","host":"s3://npm-registry-packages"},"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":1670454682894,"_cnpm_publish_time":1670454682894,"dist-tags":{"backport":"5.0.5","latest":"9.0.0","prerelease":"9.0.0-pre.0"}}