1NPM-HOOK(1)                                                        NPM-HOOK(1)
2
3
4

NAME

6       npm-hook - Manage registry hooks
7
8   Synopsis
9         npm hook ls [pkg]
10         npm hook add <entity> <url> <secret>
11         npm hook update <id> <url> [secret]
12         npm hook rm <id>
13
14       Note: This command is unaware of workspaces.
15
16   Description
17       Allows          you         to         manage         npm         hooks
18       https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifi
19       cations-of-npm, including adding, removing, listing, and updating.
20
21       Hooks  allow you to configure URL endpoints that will be notified when‐
22       ever a change happens to any of the supported entity types. Three  dif‐
23       ferent types of entities can be watched by hooks: packages, owners, and
24       scopes.
25
26       To create a package hook, simply reference the package name.
27
28       To create an owner hook, prefix the owner name with  ~  (as  in,  ~you‐
29       ruser).
30
31       To  create  a  scope  hook,  prefix  the  scope  name  with  @  (as in,
32       @yourscope).
33
34       The hook id used by update and rm are the IDs listed in npm hook ls for
35       that particular hook.
36
37       The  shared  secret  will  be sent along to the URL endpoint so you can
38       verify the request came from your own configured hook.
39
40   Example
41       Add a hook to watch a package for changes:
42
43         $ npm hook add lodash https://example.com/ my-shared-secret
44
45       Add a hook to watch packages belonging to the user substack:
46
47         $ npm hook add ~substack https://example.com/ my-shared-secret
48
49       Add a hook to watch packages in the scope @npm
50
51         $ npm hook add @npm https://example.com/ my-shared-secret
52
53       List all your active hooks:
54
55         $ npm hook ls
56
57       List your active hooks for the lodash package:
58
59         $ npm hook ls lodash
60
61       Update an existing hook's url:
62
63         $ npm hook update id-deadbeef https://my-new-website.here/
64
65       Remove a hook:
66
67         $ npm hook rm id-deadbeef
68
69   Configuration
70       <!-- AUTOGENERATED CONFIG DESCRIPTIONS  START  -->  <!--  automatically
71       generated,  do  not edit manually --> <!-- see lib/utils/config/defini‐
72       tions.js -->
73
74   registry
75       • Default: "https://registry.npmjs.org/"
76
77       • Type: URL
78
79
80       The base URL of the npm registry.  <!-- automatically generated, do not
81       edit manually --> <!-- see lib/utils/config/definitions.js -->
82
83
84   otp
85       • Default: null
86
87       • Type: null or String
88
89
90       This  is  a  one-time  password  from  a two-factor authenticator. It's
91       needed when publishing or changing package permissions with npm access.
92
93       If not set, and a registry  response  fails  with  a  challenge  for  a
94       one-time  password,  npm will prompt on the command line for one.  <!--
95       automatically  generated,  do  not   edit   manually   -->   <!--   see
96       lib/utils/config/definitions.js -->
97
98       <!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
99
100
101   See Also
102       • "Introducing               Hooks"              blog              post
103         https://blog.npmjs.org/post/145260155635/introducing-hooks-get-noti
104         fications-of-npm
105
106
107
108
109                                 October 2021                      NPM-HOOK(1)
Impressum