{"name":"libnpmorg","version":"5.0.0-pre.1","keywords":["libnpm","npm","package manager","api","orgs","teams"],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"libnpmorg@5.0.0-pre.1","maintainers":[{"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":"ee4c76d487f6bfb861205505ab0351015920a44b","tarball":"http://registry-npm.ywwl.com/libnpmorg/download/libnpmorg-5.0.0-pre.1.tgz","fileCount":4,"integrity":"sha512-9Z5PUgD/7HlIUvOEURponcEj6IR/OrOTpSH5mTPax6+fdBup5dgsmXIY9czphNtY4rE9qgOxVUOFjIp5wTVmVQ==","signatures":[{"sig":"MEUCIQDk/926Nngh7oifLv42tLIv3119FyGuHIyplRc2Fq2XxQIgDKDj66QxZwsRCOynzXORQCN150tVnn+CbOZISCcBvFI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUF8aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRxQ//fWaePyHAyp7s+/q/LGWExFnY6Ybpb0IpMa0IpxD9UDT0Pvam\r\nJaQhWgvQPLFbpAxHnlzi0cKignO7qDsGlO/2OcPSem8bXb6chZfkv9WPCnvy\r\nOrivUwZd9Lxpuvwln2jiV2z6KAToLRcc8hTn5vSvIZsroqRy2eDMwqelPQNa\r\noeWWjPh1gFQk6OiZG86CNi/FDksGkCbCTfw4HfGFl3OVcdITbAj3DLK/xMzD\r\niBXCx7hmIWGtXhuZ7boD6rnGtPaolJwyQO/9s5IAt3GBVrPzItdWSGKG32Nb\r\nT6X3WJTYkjr4o5LUrhu4N3/CsN5898Bcw5mGfdiR9nWxDwIrUiIF009fErOz\r\nUoMqpxJuAyI2af7IWmO4ldGnXs8W1VrpUxVYgQIGmgxoJTgUDrqlFIF1MZAy\r\ngzlgdB80FoJ/Un48utYt13A7jZIFq/QiqyJ/R8pAWa9o4gz8ZeBhzMqkWrrZ\r\nksZgD6Cza/8Tf82kecC3y8BqX84j4ez9M2LQf6stCy4Tlfx1m9to+APPuANd\r\nCdc8wIF2BEPhHWwbgQxRDIFNSXZPwnfpfhsAaZbGILBkdbHlZuP76IulFRUs\r\nMfkvVgLe2XNU7u8aCwaMYGgIXYT5//0gGpXJGg+mHafLtEnzmEV9U9IMJDcB\r\nDdPfSVw1BUaIFrOiXGL6vheABs9EBcZrbXA=\r\n=Xlfb\r\n-----END PGP SIGNATURE-----\r\n","size":3180,"noattachment":false,"key":"/libnpmorg/-/libnpmorg-5.0.0-pre.1.tgz"},"main":"lib/index.js","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","engines":{"node":"^14.17.0 || ^16.13.0 || >=18.0.0"},"gitHead":"728b24b869f3d802438c4ba5de57a720933c4a80","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.0.0-pre.6","description":"Programmatic api for `npm org` commands","directories":{},"templateOSS":{"content":"../../scripts/template-oss/index.js","version":"4.6.2","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"18.10.0","dependencies":{"aproba":"^2.0.0","npm-registry-fetch":"^14.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tap":"^16.0.1","nock":"^13.2.4","minipass":"^3.1.1","@npmcli/template-oss":"4.6.2","@npmcli/eslint-config":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/libnpmorg_5.0.0-pre.1_1666211610685_0.7812196846481032","host":"s3://npm-registry-packages"},"publish_time":1666211610865,"_cnpm_publish_time":1666211610865,"dist-tags":{"backport":"5.0.5","latest":"9.0.0","prerelease":"9.0.0-pre.0"}}