{"name":"libnpmaccess","version":"11.0.0","description":"programmatic library for `npm access` commands","author":{"name":"GitHub Inc."},"license":"ISC","main":"lib/index.js","scripts":{"lint":"npm run eslint","test":"tap","postlint":"template-oss-check","lintfix":"npm run eslint -- --fix","snap":"tap","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""},"devDependencies":{"@npmcli/eslint-config":"^5.0.1","@npmcli/mock-registry":"^1.0.0","@npmcli/template-oss":"5.1.1","tap":"^16.3.8"},"repository":{"type":"git","url":"git+https://github.com/npm/cli.git","directory":"workspaces/libnpmaccess"},"bugs":{"url":"https://github.com/npm/libnpmaccess/issues"},"homepage":"https://npmjs.com/package/libnpmaccess","dependencies":{"npm-package-arg":"^14.0.0","npm-registry-fetch":"^20.0.1"},"engines":{"node":"^22.22.2 || ^24.15.0 || >=26.0.0"},"templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"5.1.1","content":"../../scripts/template-oss/index.js"},"tap":{"node-arg":["--require","../../scripts/disable-agent-for-tests.js"],"nyc-arg":["--exclude","tap-snapshots/**"]},"gitHead":"aec197bf5594f0714f3e058415bb98414beab7c0","_id":"libnpmaccess@11.0.0","_nodeVersion":"26.0.0","_npmVersion":"12.0.0","dist":{"integrity":"sha512-qku5OaTtCv7f4xq5lmZMh4H6pd9WRalww3WF4PEk/aFo1Bpi7/IRCzy28EQBvyrprhzZGifbpM378U4waB9/0Q==","shasum":"989a2fe92d57778614f3e9086ad03e7e2583b0f2","tarball":"http://registry-npm.ywwl.com/libnpmaccess/download/libnpmaccess-11.0.0.tgz","fileCount":4,"unpackedSize":8616,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA6i9FsVuss/D2R4IIQqTbNdG6YKD05AO0Z4QowlJjjrAiEA3BUgirjPQRvRyCZAvZBE7/T9s8spRJ1DSAlqMJkRmjg="}],"size":3155,"noattachment":false,"key":"/libnpmaccess/-/libnpmaccess-11.0.0.tgz"},"_npmUser":{"name":"reggi","email":"reggi@github.com"},"directories":{},"maintainers":[{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},{"name":"reggi","email":"reggi@github.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/libnpmaccess_11.0.0_1783544730346_0.8406181981878942"},"_hasShrinkwrap":false,"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":1783544730468,"_cnpm_publish_time":1783544730468,"dist-tags":{"backport":"7.0.3","latest":"11.0.0","prerelease":"11.0.0-pre.0"}}