关于包和模块
See Details
目录
npm 注册表包含包,其中许多也是 Node 模块,或者包含 Node 模块。继续阅读以了解它们的不同之处以及它们如何相互作用。
¥The npm registry contains packages, many of which are also Node modules, or contain Node modules. Read on to understand how they differ and how they interact.
关于包
¥About packages
包是由 package.json
文件描述的文件或目录。包必须包含 package.json
文件才能发布到 npm 注册表。有关创建 package.json
文件的更多信息,请参阅“创建 package.json 文件”。
¥A package is a file or directory that is described by a package.json
file. A package must contain a package.json
file in order to be published to the npm registry. For more information on creating a package.json
file, see "Creating a package.json file".
包可以不限定范围或限定给用户或组织,限定范围的包可以是私有的或公共的。有关详细信息,请参阅
¥Packages can be unscoped or scoped to a user or organization, and scoped packages can be private or public. For more information, see
-
"关于范围"
¥"About scopes"
-
"关于私有包"
关于包的格式
¥About package formats
包是以下任何一种:
¥A package is any of the following:
-
a) 包含由
package.json
文件描述的程序的文件夹。¥a) A folder containing a program described by a
package.json
file. -
b) 包含 (a) 的压缩包。
¥b) A gzipped tarball containing (a).
-
c) 解析为 (b) 的 URL。
¥c) A URL that resolves to (b).
-
d) 与 (c) 一起在注册表上发布的
<name>@<version>