npm-org

管理组织

选择命令行版本:

概要

🌐 Synopsis

npm org set orgname username [developer | admin | owner]
npm org rm orgname username
npm org ls orgname [<username>]
alias: ogr

注意:此命令不支持工作区。

🌐 Note: This command is unaware of workspaces.

示例

🌐 Example

将新开发者添加到组织:

🌐 Add a new developer to an org:

$ npm org set my-org @mx-smith

向组织添加新管理员(或将开发者更改为管理员):

🌐 Add a new admin to an org (or change a developer to an admin):

$ npm org set my-org @mx-santos admin

从组织中删除用户:

🌐 Remove a user from an org:

$ npm org rm my-org mx-santos

列出组织中的所有用户:

🌐 List all users in an org:

$ npm org ls my-org

以 JSON 格式列出所有用户:

🌐 List all users in JSON format:

$ npm org ls my-org --json

查看用户在组织中的角色:

🌐 See what role a user has in an org:

$ npm org ls my-org @mx-santos

描述

🌐 Description

你可以使用 npm org 命令来管理和查看组织的用户。它支持添加和移除用户、更改他们的角色、列出所有用户,以及查找特定用户及其角色。

🌐 You can use the npm org commands to manage and view users of an organization. It supports adding and removing users, changing their roles, listing them, and finding specific ones and their roles.

配置

🌐 Configuration

registry

  • 默认: "https://registry.npmjs.org/"
  • 类型:网址

npm 注册表的基本 URL。

🌐 The base URL of the npm registry.

otp

  • 默认值:空
  • 类型:空或字符串

这是来自双因素认证器的一次性密码。在使用 npm access 发布或更改软件包权限时需要此密码。

🌐 This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with npm access.

如果未设置,并且注册表响应失败并询问一次性密码,npm 将在命令行上提示输入一次密码。

🌐 If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.

json

  • 默认:否
  • 类型:布尔

是否输出 JSON 数据,而不是正常输出。

🌐 Whether or not to output JSON data, rather than the normal output.

  • npm pkg set 中,它可以在将值保存到你的 package.json 之前使用 JSON.parse() 解析设置的值。

并非所有 npm 命令都支持。

🌐 Not supported by all npm commands.

parseable

  • 默认:否
  • 类型:布尔

从写入标准输出的命令中输出可解析的结果。对于 npm search,这将是制表符分隔的表格格式。

🌐 Output parseable results from commands that write to standard output. For npm search, this will be tab-separated table format.

也可以看看

🌐 See Also