NPM hooks package:change prioritized over package:publish

What I Wanted to Do

Have a consistent NPM webhook for package:publish events.

I have a webhook listening and handling package:publish events. It works well. However, I noticed in some cases when you update other fields in the package.json of the published package this event is never emitted. Another package:change is emitted instead (with empty changes, by the way).

I’d like ALL NPM registry publishes to trigger a package:publish event, regardless of what changed. Whether or not you trigger a separate package:change event does not bother me.

What Happened Instead

I got a package:change when a new package version was published, but not a package:publish.

Reproduction Steps

  1. Setup webhook for a particular package.
  2. Change version and keywords for said package.
  3. NPM publish it.
  4. See event name:
  • expected package:publish
  • received package:change

Details