How to register package installation events in Atom Editor?


#1

I would like to create an Atom package that is triggered to run when any package is installed, updated and uninstalled. How can I register to such events to trigger my package callback?

In the API docs (https://atom.io/docs/api/v1.2.4/PackageManager), it seems like there are only load/unload/activate/deactivate events.


Run a script on package install, and deactivate
#2

You are correct. There are currently no install, uninstall or update events in the Atom API. Packages are deactivated on uninstall, activated on install, and deactivated and then activated on update. You could track what packages are activated in combination with watching paths and version numbers to make determinations about installation and such.

The other thing to keep in mind is that these events would not be complete since one can always install, uninstall and such when Atom is not running using the apm tool.