{
"_from": "libnpmorg@1.0.1",
"_id": "libnpmorg@1.0.1",
"_inBundle": false,
"_integrity": "sha512-0sRUXLh+PLBgZmARvthhYXQAWn0fOsa6T5l3JSe2n9vKG/lCVK4nuG7pDsa7uMq+uTt2epdPK+a2g6btcY11Ww==",
"_location": "/npm/libnpmorg",
"_phantomChildren": {},
"_requested": {
"escapedName": "libnpmorg",
"fetchSpec": "1.0.1",
"name": "libnpmorg",
"raw": "libnpmorg@1.0.1",
"rawSpec": "1.0.1",
"registry": true,
"saveSpec": null,
"type": "version"
},
"_requiredBy": [
"#USER",
"/npm",
"/npm/libnpm"
],
"_resolved": "https://registry.npmjs.org/libnpmorg/-/libnpmorg-1.0.1.tgz",
"_shasum": "5d2503f6ceb57f33dbdcc718e6698fea6d5ad087",
"_shrinkwrap": null,
"_spec": "libnpmorg@1.0.1",
"_where": "/Users/isaacs/dev/npm/cli",
"author": {
"email": "kzm@zkat.tech",
"name": "Kat Marchán"
},
"bugs": {
"url": "https://github.com/npm/libnpmorg/issues"
},
"bundleDependencies": false,
"dependencies": {
"aproba": "^2.0.0",
"figgy-pudding": "^3.4.1",
"get-stream": "^4.0.0",
"npm-registry-fetch": "^4.0.0"
},
"deprecated": false,
"description": "Programmatic api for `npm org` commands",
"devDependencies": {
"nock": "^9.6.1",
"standard": "^12.0.0",
"standard-version": "*",
"tap": "*",
"weallbehave": "*",
"weallcontribute": "*"
},
"homepage": "https://npmjs.com/package/libnpmorg",
"keywords": [
"api",
"libnpm",
"npm",
"orgs",
"package manager",
"teams"
],
"license": "ISC",
"name": "libnpmorg",
"optionalDependencies": {},
"readme": "# libnpmorg [](https://npm.im/libnpmorg) [](https://npm.im/libnpmorg) [](https://travis-ci.org/npm/libnpmorg) [](https://ci.appveyor.com/project/zkat/libnpmorg) [](https://coveralls.io/github/npm/libnpmorg?branch=latest)\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## 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## Table of Contents\n\n* [Example](#example)\n* [Install](#install)\n* [API](#api)\n * [hook opts](#opts)\n * [`set()`](#set)\n * [`rm()`](#rm)\n * [`ls()`](#ls)\n * [`ls.stream()`](#ls-stream)\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* `opts.Promise` - If you pass this in, the Promises returned by `libnpmorg` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}`\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",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/libnpmorg.git"
},
"scripts": {
"postrelease": "npm publish && git push --follow-tags",
"prerelease": "npm t",
"pretest": "standard",
"release": "standard-version -s",
"test": "tap -J --100 test/*.js",
"update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",
"update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"
},
"version": "1.0.1"
}