npm-hook
选择命令行版本:
See Details
目录
概要
¥Synopsis
npm hook add <pkg> <url> <secret> [--type=<type>]npm hook ls [pkg]npm hook rm <id>npm hook update <id> <url> <secret>
注意:此命令对工作区无感知。
¥Note: This command is unaware of workspaces.
描述
¥Description
允许你管理 npm hooks,包括添加、删除、列出和更新。
¥Allows you to manage npm hooks, including adding, removing, listing, and updating.
钩子允许你配置 URL 端点,只要任何受支持的实体类型发生更改,就会通知这些端点。钩子可以监视三种不同类型的实体:包、所有者和范围。
¥Hooks allow you to configure URL endpoints that will be notified whenever a change happens to any of the supported entity types. Three different types of entities can be watched by hooks: packages, owners, and scopes.
要创建包钩子,只需引用包名称。
¥To create a package hook, simply reference the package name.
要创建所有者钩子,请在所有者名称前加上 ~
(如 ~youruser
)。
¥To create an owner hook, prefix the owner name with ~
(as in, ~youruser
).
要创建范围钩子,请在范围名称前加上 @
(如 @yourscope
)。
¥To create a scope hook, prefix the scope name with @
(as in, @yourscope
).
update
和 rm
使用的钩子 id
是 npm hook ls
中为该特定钩子列出的 ID。
¥The hook id
used by update
and rm
are the IDs listed in npm hook ls
for that particular hook.
共享密钥将被发送到 URL 端点,因此你可以验证请求来自你自己配置的钩子。
¥The shared secret will be sent along to the URL endpoint so you can verify the request came from your own configured hook.