npm-hook.1 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. .TH "NPM\-HOOK" "1" "August 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-hook\fR \- Manage registry hooks
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm hook ls [pkg]
  9. npm hook add <entity> <url> <secret>
  10. npm hook update <id> <url> [secret]
  11. npm hook rm <id>
  12. .fi
  13. .RE
  14. .SS Example
  15. .P
  16. Add a hook to watch a package for changes:
  17. .P
  18. .RS 2
  19. .nf
  20. $ npm hook add lodash https://example\.com/ my\-shared\-secret
  21. .fi
  22. .RE
  23. .P
  24. Add a hook to watch packages belonging to the user \fBsubstack\fP:
  25. .P
  26. .RS 2
  27. .nf
  28. $ npm hook add ~substack https://example\.com/ my\-shared\-secret
  29. .fi
  30. .RE
  31. .P
  32. Add a hook to watch packages in the scope \fB@npm\fP
  33. .P
  34. .RS 2
  35. .nf
  36. $ npm hook add @npm https://example\.com/ my\-shared\-secret
  37. .fi
  38. .RE
  39. .P
  40. List all your active hooks:
  41. .P
  42. .RS 2
  43. .nf
  44. $ npm hook ls
  45. .fi
  46. .RE
  47. .P
  48. List your active hooks for the \fBlodash\fP package:
  49. .P
  50. .RS 2
  51. .nf
  52. $ npm hook ls lodash
  53. .fi
  54. .RE
  55. .P
  56. Update an existing hook's url:
  57. .P
  58. .RS 2
  59. .nf
  60. $ npm hook update id\-deadbeef https://my\-new\-website\.here/
  61. .fi
  62. .RE
  63. .P
  64. Remove a hook:
  65. .P
  66. .RS 2
  67. .nf
  68. $ npm hook rm id\-deadbeef
  69. .fi
  70. .RE
  71. .SS Description
  72. .P
  73. Allows you to manage npm hooks \fIhttps://blog\.npmjs\.org/post/145260155635/introducing\-hooks\-get\-notifications\-of\-npm\fR,
  74. including adding, removing, listing, and updating\.
  75. .P
  76. Hooks allow you to configure URL endpoints that will be notified whenever a
  77. change happens to any of the supported entity types\. Three different types of
  78. entities can be watched by hooks: packages, owners, and scopes\.
  79. .P
  80. To create a package hook, simply reference the package name\.
  81. .P
  82. To create an owner hook, prefix the owner name with \fB~\fP (as in, \fB~youruser\fP)\.
  83. .P
  84. To create a scope hook, prefix the scope name with \fB@\fP (as in, \fB@yourscope\fP)\.
  85. .P
  86. The hook \fBid\fP used by \fBupdate\fP and \fBrm\fP are the IDs listed in \fBnpm hook ls\fP for
  87. that particular hook\.
  88. .P
  89. The shared secret will be sent along to the URL endpoint so you can verify the
  90. request came from your own configured hook\.
  91. .SS See Also
  92. .RS 0
  93. .IP \(bu 2
  94. "Introducing Hooks" blog post \fIhttps://blog\.npmjs\.org/post/145260155635/introducing\-hooks\-get\-notifications\-of\-npm\fR
  95. .RE