orgs

与团队和组织合作

选择 CLI 版本:

描述

Description

组织用户分为三个级别:

There are three levels of org users:

  1. 超级管理员,控制计费并将人员添加到组织。

    Super admin, controls billing & adding people to the org.

  2. 团队管理员,管理团队成员和包访问。

    Team admin, manages team membership & package access.

  3. 开发者,在他们有权访问的包上工作。

    Developer, works on packages they are given access to.

超级管理员是唯一可以将用户添加到组织的人,因为它会影响月度账单。超级管理员将使用该网站来管理会员资格。每个组织都有一个 developers 团队,所有用户都会自动添加到该团队。

The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a developers team that all users are automatically added to.

团队管理员是为团队管理团队创建、团队成员资格和包访问权限的人。团队管理员向团队而非个人授予包访问权限。

The team admin is the person who manages team creation, team membership, and package access for teams. The team admin grants package access to teams, not individuals.

开发者将能够根据他们所在的团队访问包。访问是读写或只读的。

The developer will be able to access packages based on the teams they are on. Access is either read-write or read-only.

有两个主要命令:

There are two main commands:

  1. npm team 详见 npm team

    npm team see npm team for more details

  2. npm access 详见 npm access

    npm access see npm access for more details

团队管理员创建团队

Team Admins create teams

  • 检查你已将谁添加到你的组织:

    Check who you’ve added to your org:

npm team ls <org>:developers
  • 每个组织都会自动分配一个 developers 团队,因此你可以查看组织中团队成员的完整列表。该团队自动获得对所有包的读写访问权限,但你可以使用 access 命令更改它。

    Each org is automatically given a developers team, so you can see the whole list of team members in your org. This team automatically gets read-write access to all packages, but you can change that with the access command.

  • 创建一个新团队:

    Create a new team:

npm team create <org:team>
  • 将成员添加到该团队:

    Add members to that team:

npm team add <org:team> <user>

发布包并调整包访问

Publish a package and adjust package access

  • 在包目录中,运行

    In package directory, run

npm init --scope=<org>

为你的组织确定范围并照常发布

to scope it for your org & publish as usual

  • 授予访问权限:

    Grant access:

npm access grant <read-only|read-write> <org:team> [<package>]
  • 撤销访问:

    Revoke access:

npm access revoke <org:team> [<package>]

监控你的包访问

Monitor your package access

  • 查看团队成员可以访问哪些组织包:

    See what org packages a team member can access:

npm access ls-packages <org> <user>
  • 查看特定团队可用的包:

    See packages available to a specific team:

npm access ls-packages <org:team>
  • 检查哪些团队正在协作处理一个包:

    Check which teams are collaborating on a package:

npm access ls-collaborators <pkg>

也可以看看

See also

npm 中文网 - 粤ICP备13048890号