关于 npm

npm 是世界上最大的软件注册表。来自各大洲的开源开发者使用 npm 来共享和借用包,许多组织也使用 npm 来管理私有开发。

¥npm is the world's largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well.

npm 由三个不同的组件组成:

¥npm consists of three distinct components:

  • 网站

    ¥the website

  • 命令行接口 (CLI)

    ¥the Command Line Interface (CLI)

  • 注册表

    ¥the registry

使用 网站 发现包、设置配置、以及管理 npm 体验的其他方面。例如,你可以设置 组织 来管理对公共或私有包的访问。

¥Use the website to discover packages, set up profiles, and manage other aspects of your npm experience. For example, you can set up organizations to manage access to public or private packages.

CLI 从终端运行,是大多数开发者与 npm 交互的方式。

¥The CLI runs from a terminal, and is how most developers interact with npm.

注册表 是 JavaScript 软件及其周围元信息的大型公共数据库。

¥The registry is a large public database of JavaScript software and the meta-information surrounding it.

使用 npm 去 . . .

¥Use npm to . . .

  • 为你的应用调整代码包,或按原样合并包。

    ¥Adapt packages of code for your apps, or incorporate packages as they are.

  • 下载你可以立即使用的独立工具。

    ¥Download standalone tools you can use right away.

  • 使用 npx 运行包而不下载。

    ¥Run packages without downloading using npx.

  • 随时随地与任何 npm 用户共享代码。

    ¥Share code with any npm user, anywhere.

  • 将代码限制为特定的开发者。

    ¥Restrict code to specific developers.

  • 创建组织以协调包维护、编码和开发者。

    ¥Create organizations to coordinate package maintenance, coding, and developers.

  • 通过使用组织形成虚拟团队。

    ¥Form virtual teams by using organizations.

  • 管理多个版本的代码和代码依赖。

    ¥Manage multiple versions of code and code dependencies.

  • 更新底层代码时轻松更新应用。

    ¥Update applications easily when underlying code is updated.

  • 发现解决同一个难题的多种方法。

    ¥Discover multiple ways to solve the same puzzle.

  • 寻找正在处理类似问题和项目的其他开发者。

    ¥Find other developers who are working on similar problems and projects.

新手入门

¥Getting started

要开始使用 npm,你可以 创建账号,它将在 http://www.npmjs.com/~yourusername 提供。

¥To get started with npm, you can create an account, which will be available at http://www.npmjs.com/~yourusername.

设置好 npm 账户后,下一步是使用命令行接口 (CLI) 访问 安装 npm。我们期待看到你创造的东西!

¥After you set up an npm account, the next step is to use the command line interface (CLI) to install npm. We look forward to seeing what you create!

共享包和与他人协作

¥Sharing packages and collaborating with others

如果你选择公开分享你的包,则无需支付任何费用。要使用和共享私有包,你需要升级你的账户。要与他人分享,创建名为 npm 组织 的组织,并邀请他人与你合作,私有(收费)或公开(免费)。

¥If you choose to share your packages publicly, there is no cost. To use and share private packages, you need to upgrade your account. To share with others, create organizations, called npm organizations, and invite others to work with you, privately (for a fee) or publicly (for free).

你还可以使用私有 npm 包注册表,如 GitHub 包 或开源 Verdaccio 项目。这使你可以在内部开发不公开共享的包。

¥You can also use a private npm package registry like GitHub Packages or the open source Verdaccio project. This lets you develop packages internally that are not shared publicly.

了解更多

¥Learn more

要了解有关 npm 作为产品、即将推出的新功能以及 npm 有趣用途的更多信息,请务必在 Twitter 上关注 @npmjs

¥To learn more about npm as a product, upcoming new features, and interesting uses of npm be sure to follow @npmjs on Twitter.

如需指导、教程和学习,请访问 node school。考虑在你附近的站点参加或举办 nodeschool 活动(通常是免费的!),或使用你可以在该站点上找到的自助工具。

¥For mentoring, tutorials, and learning, visit node school. Consider attending or hosting a nodeschool event (usually free!) at a site near you, or use the self-help tools you can find on the site.

CLI 参考文档

¥CLI reference documentation

虽然本用户文档中涵盖了相关的 CLI 命令,但 CLI 包括命令行帮助,它自己的 文档部分和即时帮助(手册页)

¥While relevant CLI commands are covered throughout this user documentation, the CLI includes command line help, its own documentation section, and instant help (man pages).

npm 中文网 - 粤ICP备13048890号