{"name":"libnpmaccess","version":"10.0.0","author":{"name":"GitHub Inc."},"license":"ISC","_id":"libnpmaccess@10.0.0","maintainers":[{"name":"fritzy","email":"fritzy@github.com"},{"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"}],"homepage":"https://npmjs.com/package/libnpmaccess","bugs":{"url":"https://github.com/npm/libnpmaccess/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"a5279a683af982fa971599d37ed471e59339bd01","tarball":"http://registry-npm.ywwl.com/libnpmaccess/download/libnpmaccess-10.0.0.tgz","fileCount":4,"integrity":"sha512-Nz9Lolajvh6nPA5ixdKNfN2BJS0N7LvqTXPqy3+F37i3T4mcped24JCjwnp5KCPCB0ewX3ccopwUnhaTS1/yXg==","signatures":[{"sig":"MEYCIQDBVvbdCi3XkXfpVip/HWzLfcLgb6/RcLv8lrwGQ9HkVwIhAOY2ZM5qnCX47eosHyWntT9Sm7aLo1LMMAHWiiYNYJ8I","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8498,"size":3132,"noattachment":false,"key":"/libnpmaccess/-/libnpmaccess-10.0.0.tgz"},"main":"lib/index.js","engines":{"node":"^20.17.0 || >=22.9.0"},"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":"gar","email":"gar+npm@danger.computer"},"repository":{"url":"git+https://github.com/npm/cli.git","type":"git","directory":"workspaces/libnpmaccess"},"_npmVersion":"11.0.0","description":"programmatic library for `npm access` commands","directories":{},"templateOSS":{"content":"../../scripts/template-oss/index.js","version":"4.23.6","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"22.12.0","dependencies":{"npm-package-arg":"^12.0.0","npm-registry-fetch":"^18.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.8","@npmcli/template-oss":"4.23.6","@npmcli/eslint-config":"^5.0.1","@npmcli/mock-registry":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/libnpmaccess_10.0.0_1734369114907_0.9577530712158819","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":1734369115080,"_cnpm_publish_time":1734369115080,"dist-tags":{"backport":"7.0.3","latest":"11.0.0","prerelease":"11.0.0-pre.0"}}