{"name":"libnpmorg","version":"4.0.3","keywords":["libnpm","npm","package manager","api","orgs","teams"],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"libnpmorg@4.0.3","maintainers":[{"name":"fritzy","email":"fritzy@github.com"},{"name":"darcyclarke","email":"darcy@darcyclarke.me"},{"name":"ruyadorno","email":"ruyadorno@hotmail.com"},{"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":{"check-coverage":true},"dist":{"shasum":"a85cbdb3665ad4f7c7279d239a4581ec2eeef5a6","tarball":"http://registry-npm.ywwl.com/libnpmorg/download/libnpmorg-4.0.3.tgz","fileCount":4,"integrity":"sha512-r4CpmCEF+e5PbFMBi64xSXmqn0uGgV4T7NWpGL4/A6KT/DTtIxALILQZq+l0ZdN1xm4RjOvqSDR22oT4il8rAQ==","signatures":[{"sig":"MEUCIDlCh8lo4Ra7Bm0gI78yhHU/0cgFM+mwUkoUyZVvjdNKAiEAyRX5fBFKL6VRq4PHlMmdhT2iFGNfj5jkJ0MgrnoSMJc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiT1CgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2wg/5AB+ZwASjO4YosJ7LskkGN/i2t1jwDtymFcp3n6KRAvaPq5qp\r\n1hZAKDzJz2lZOpf/N5fd2KBmQx7ynVG3SBCrC03z8cDBYkuWPfzK/2yldrHx\r\nn8ulWuD3Mk2ajw7/g+FMUJ4PbiWy3xLD341ttW3JcBYfmkBhEtle3zFIc/la\r\njNyJZuHxolRQi/pw8FOJ3VcNzNeb1XRtkAkdS/FEBGk5a1LNyL5UkOtG3dtb\r\nnvH3PLdHjXa6kkJ+ulznJg7ICifj55LCwGyCA4ZELbx0+iaC7Y+rWGmVE8YA\r\n094vmTvQiP3nOjBs1/g0as3Mewuk2+rJ7c83BPiyG8rd3iesbB2h+P/akcom\r\nmzLwSfMXcfA9+pPQEwUrJIq0uld+p6sGFtNYjGFwY6uAl7vwYvu5rxpOWz5w\r\n/J4ZTdgbvX8X8FUpXAEQcjMyaf5vuY0+G4YaQ3uxauRZ1LBSdC5QYbaaYPGk\r\nJzr29f6Rs0kIHkIrIDk/nmS7CpxW9DwN6PO4wfXMSaCiK+cATfQDkpMlrlOI\r\nJAilN9lrYiFdPjZ/1ryYVJWllo2R2n1z5g/0ghIEqqVjFlASGDrK4WW7DDqc\r\naotjYbLe5wIHdMGvwSXM5K4T2dN1C0s7IIbnxCddpJtn2KC3olTsZq0wlZu+\r\n+wQRJujHy6u06aLVtN/Wsyf8RwHPs1HBuVI=\r\n=k0+H\r\n-----END PGP SIGNATURE-----\r\n","size":3174,"noattachment":false,"key":"/libnpmorg/-/libnpmorg-4.0.3.tgz"},"main":"lib/index.js","engines":{"node":"^12.13.0 || ^14.15.0 || >=16.0.0"},"gitHead":"1617bce61663a743435d162b003d3b99376d426f","scripts":{"lint":"eslint \"**/*.js\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","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":"8.6.0","description":"Programmatic api for `npm org` commands","directories":{},"templateOSS":{"version":"3.3.2","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"16.14.2","dependencies":{"aproba":"^2.0.0","npm-registry-fetch":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.1","nock":"^13.2.4","minipass":"^3.1.1","@npmcli/template-oss":"3.3.2","@npmcli/eslint-config":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/libnpmorg_4.0.3_1649365152491_0.910240642544665","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":1649365152861,"_cnpm_publish_time":1649365152861,"dist-tags":{"backport":"5.0.5","latest":"9.0.0","prerelease":"9.0.0-pre.0"}}