PackageManager extended
Package manager for coordinating the lifecycle of Atom packages.
An instance of this class is always available as the atom.packages
global.
Packages can be loaded, activated, and deactivated, and unloaded:
- Loading a package reads and parses the package's metadata and resources such as keymaps, menus, stylesheets, etc.
- Activating a package registers the loaded resources and calls
activate()
on the package's main module. - Deactivating a package unregisters the package's resources and calls
deactivate()
on the package's main module. - Unloading a package removes it completely from the package manager.
Packages can be enabled/disabled via the core.disabledPackages
config
settings and also by calling enablePackage()/disablePackage()
.
Event Subscription
::onDidLoadInitialPackages(callback)
Invoke the given callback when all packages have been loaded.
Argument | Description |
---|---|
callback() |
Return values |
---|
Returns a Disposable on which |
::onDidActivateInitialPackages(callback)
Invoke the given callback when all packages have been activated.
Argument | Description |
---|---|
callback() |
Return values |
---|
Returns a Disposable on which |
::onDidActivatePackage(callback)
Invoke the given callback when a package is activated.
Argument | Description |
---|---|
callback(package) |
A Function to be invoked when a package is activated. |
package |
The Package that was activated. |
Return values |
---|
Returns a Disposable on which |
::onDidDeactivatePackage(callback)
Invoke the given callback when a package is deactivated.
Argument | Description |
---|---|
callback(package) |
A Function to be invoked when a package is deactivated. |
package |
The Package that was deactivated. |
Return values |
---|
Returns a Disposable on which |
::onDidLoadPackage(callback)
Invoke the given callback when a package is loaded.
Argument | Description |
---|---|
callback(package) |
A Function to be invoked when a package is loaded. |
package |
The Package that was loaded. |
Return values |
---|
Returns a Disposable on which |
::onDidUnloadPackage(callback)
Invoke the given callback when a package is unloaded.
Argument | Description |
---|---|
callback(package) |
A Function to be invoked when a package is unloaded. |
package |
The Package that was unloaded. |
Return values |
---|
Returns a Disposable on which |
Package system data
::getApmPath()
Get the path to the apm command.
Uses the value of the core.apmPath
config setting if it exists.
Return a String file path to apm.