{"name":"libnpmorg","version":"1.0.0","keywords":["libnpm","npm","package manager","api","orgs","teams"],"author":{"name":"Kat Marchán","email":"kzm@zkat.tech"},"license":"ISC","_id":"libnpmorg@1.0.0","maintainers":[{"name":"zkat","email":"npm@zkat.tech"}],"homepage":"https://npmjs.com/package/libnpmorg","bugs":{"url":"https://github.com/npm/libnpmorg/issues"},"dist":{"shasum":"979b868c48ba28c5820e3bb9d9e73c883c16a232","tarball":"http://registry-npm.ywwl.com/libnpmorg/download/libnpmorg-1.0.0.tgz","fileCount":10,"integrity":"sha512-o+4eVJBoDGMgRwh2lJY0a8pRV2c/tQM/SxlqXezjcAg26Qe9jigYVs+Xk0vvlYDWCDhP0g74J8UwWeAgsB7gGw==","signatures":[{"sig":"MEUCIQDzeLw+lRidn1wN+zfE7kXuVh/uOOhbVE5iO+miQVCh5wIgajsUeg7xbpHDJyFJtQ9RfcWDVzzXsz9pPPAItrzc6H8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbf0k3CRA9TVsSAnZWagAAX/gQAIk0cwi4JrM50IBiSrjC\n5dv+7tvf6HpBtThwOUxV8+VZQMFGJbbs+gCR1dcVmuvhgfJ9sEILr5jGddwn\ndos0okrxTY3lK1SfIjKWbDBFKG/xnkWw5Oa7adnnx7nW4JZEdTw7HmXTiFJX\nuS599AqvMN0XFulyFWMKLySoW0T9bk2s09+hiMTX8htW5C8lJosCgp13NHZK\n8TaGUMIBl/IUYHPPnD87SJ/r2V6GunMpTm9nLnpExcThws6vI6Ds0nV4fvNa\nL+BBjhAl2VxaF9IsXjJ53ayABAQkjvC+yruoZkBC+iuLvyIc7lZj4Kr62n0T\nwKOqhEbioiTYT3VVV4zPOrOwuSWgmHXtc8zXjgSU6ASHjkaYu7pruoNPVgi2\nB+TbwNGi0S2Lx5msENadhKfhWo/xbZifi+wZnKjN6/Hvgcp5Y2IhmuIK07by\nGBiR8ewJz35lWwHyvG2SFZRkvDAgIV6KYXsiF2XCYX/V1o19bINZft8Ksxrj\n+Ex/qUb+59Gc4ceCf27ynrg2z0GbcQDF0oBQc3yY60hHzWretxiUFVcLtndc\n1D3+dP62lRK/GcHs5xQwZ4ckL71Whj8zJmddKY1BVY87suFL/dLgo+l5y4tS\nUh6vdOg0RsDB2hGAPVnDDkxWyxWfCtuf973mK/PWqJSF4QowUvMeQRO1K2Eq\n70Xf\r\n=UPV2\r\n-----END PGP SIGNATURE-----\r\n","size":15509,"noattachment":false,"key":"/libnpmorg/-/libnpmorg-1.0.0.tgz"},"gitHead":"af089a06b620db9b17da9fecd67c2268b6f93ea8","scripts":{"test":"tap -J --100 test/*.js","pretest":"standard","release":"standard-version -s","prerelease":"npm t","update-coc":"weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'","postrelease":"npm publish && git push --follow-tags","update-contrib":"weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"},"_npmUser":{"name":"zkat","email":"npm@zkat.tech"},"repository":{"url":"git+https://github.com/npm/libnpmorg.git","type":"git"},"_npmVersion":"6.4.1-next.0","description":"Programmatic api for `npm org` commands","directories":{},"_nodeVersion":"10.6.0","dependencies":{"aproba":"^2.0.0","get-stream":"^4.0.0","figgy-pudding":"^3.4.1","npm-registry-fetch":"^3.8.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"*","nock":"^9.6.1","standard":"*","weallbehave":"*","weallcontribute":"*","standard-version":"*"},"_npmOperationalInternal":{"tmp":"tmp/libnpmorg_1.0.0_1535068470616_0.5864554524881789","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":1535068470714,"_cnpm_publish_time":1535068470714,"dist-tags":{"backport":"5.0.5","latest":"9.0.0","prerelease":"9.0.0-pre.0"}}