{"name":"libnpmaccess","version":"10.0.2","author":{"name":"GitHub Inc."},"license":"ISC","_id":"libnpmaccess@10.0.2","maintainers":[{"name":"gar","email":"gar+npm@danger.computer"},{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},{"name":"reggi","email":"reggi@github.com"},{"name":"hashtagchris","email":"hashtagchris@github.com"},{"name":"owlstronaut","email":"owlstronaut@github.com"}],"homepage":"https://npmjs.com/package/libnpmaccess","bugs":{"url":"https://github.com/npm/libnpmaccess/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"bd74cdfcbe42aeb882187b965fa182eb98383ae8","tarball":"http://registry-npm.ywwl.com/libnpmaccess/download/libnpmaccess-10.0.2.tgz","fileCount":4,"integrity":"sha512-WQI+aBcwyAfhor2yDL8OUV/jkrQLzObMED27jigpVdlqZPXxbBua1C+yFpHJfmj3gHRg+Se4glzlrKAazd8INg==","signatures":[{"sig":"MEUCIQCBTPQ/6QPCXBm6LNlTArZV4twzQi7wG0VOOtoRFV2wjAIgRcQBU7+3sIHRBrP5QfDLIAyok8CnBMMMik+0ydfA2nA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8513,"size":3130,"noattachment":false,"key":"/libnpmaccess/-/libnpmaccess-10.0.2.tgz"},"main":"lib/index.js","engines":{"node":"^20.17.0 || >=22.9.0"},"gitHead":"786ec4139c5f278f708765a0a7fd33a987ac0acb","scripts":{"lint":"npm run eslint","snap":"tap","test":"tap","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","lintfix":"npm run eslint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"owlstronaut","email":"owlstronaut@github.com"},"repository":{"url":"git+https://github.com/npm/cli.git","type":"git","directory":"workspaces/libnpmaccess"},"_npmVersion":"11.6.1","description":"programmatic library for `npm access` commands","directories":{},"templateOSS":{"content":"../../scripts/template-oss/index.js","version":"4.25.1","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"23.11.0","dependencies":{"npm-package-arg":"^13.0.0","npm-registry-fetch":"^19.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.8","@npmcli/template-oss":"4.25.1","@npmcli/eslint-config":"^5.0.1","@npmcli/mock-registry":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/libnpmaccess_10.0.2_1758740390587_0.908245204424285","host":"s3://npm-registry-packages-npm-production"},"readme":"# libnpmaccess\n\n[![npm version](https://img.shields.io/npm/v/libnpmaccess.svg)](https://npm.im/libnpmaccess)\n[![license](https://img.shields.io/npm/l/libnpmaccess.svg)](https://npm.im/libnpmaccess)\n[![CI - libnpmaccess](https://github.com/npm/cli/actions/workflows/ci-libnpmaccess.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmaccess.yml)\n\n[`libnpmaccess`](https://github.com/npm/libnpmaccess) is a Node.js\nlibrary that provides programmatic access to the guts of the npm CLI's `npm\naccess` command. This includes managing account mfa settings, listing\npackages and permissions, looking at package collaborators, and defining\npackage permissions for users, orgs, and teams.\n\n## Example\n\n```javascript\nconst access = require('libnpmaccess')\nconst opts = { '//registry.npmjs.org/:_authToken: 'npm_token }\n\n// List all packages @zkat has access to on the npm registry.\nconsole.log(Object.keys(await access.getPackages('zkat', opts)))\n```\n\n### API\n\n#### `opts` for all `libnpmaccess` commands\n\n`libnpmaccess` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch).\n\nAll options are passed through directly to that library, so please refer\nto [its own `opts`\ndocumentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options)\nfor options that can be passed in.\n\n#### `spec` parameter for all `libnpmaccess` commands\n\n`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible\nregistry spec.\n\n#### `access.getCollaborators(spec, opts) -> Promise<Object>`\n\nGets collaborators for a given package\n\n#### `access.getPackages(user|scope|team, opts) -> Promise<Object>`\n\nGets all packages for a given user, scope, or team.\n\nTeams should be in the format `scope:team` or `@scope:team`\n\nUsers and scopes can be in the format `@scope` or `scope`\n\n#### `access.getVisibility(spec, opts) -> Promise<Object>`\n\nGets the visibility of a given package\n\n#### `access.removePermissions(team, spec, opts) -> Promise<Boolean>`\n\nRemoves the access for a given team to a package.\n\nTeams should be in the format `scope:team` or `@scope:team`\n\n#### `access.setAccess(package, access, opts) -> Promise<Boolean>`\n\nSets access level for package described by `spec`.\n\nThe npm registry accepts the following `access` levels:\n\n- `public`: package is public\n- `private`: package is private\n\nThe npm registry also only allows scoped packages to have their access\nlevel set.\n\n#### access.setMfa(spec, level, opts) -> Promise<Boolean>`\n\nSets the publishing mfa requirements for a given package.  Level must be one of the\nfollowing:\n\n- `none`: mfa is not required to publish this package.\n- `publish`: mfa is required to publish this package, automation tokens\ncannot be used to publish.\n- `automation`: mfa is required to publish this package, automation tokens\nmay also be used for publishing from continuous integration workflows.\n\n#### access.setPermissions(team, spec, permissions, opts) -> Promise<Boolean>`\n\nSets permissions levels for a given team to a package.\n\nTeams should be in the format `scope:team` or `@scope:team`\n\nThe npm registry accepts the following `permissions`:\n\n- `read-only`: Read only permissions\n- `read-write`: Read and write (aka publish) permissions\n","publish_time":1758740390826,"_cnpm_publish_time":1758740390826,"dist-tags":{"backport":"7.0.3","latest":"11.0.0","prerelease":"11.0.0-pre.0"}}