Summary
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
- Package system data
- General package data
- Enabling and disabling packages
- Accessing active packages
- Accessing loaded packages
- Accessing available packages
Instance Methods
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 |
A Function to be invoked when a package is activated. |
Return Values |
---|
Returns a {Disposable} on which |
onDidDeactivatePackage(callback)
Invoke the given callback when a package is deactivated.
Argument | Description |
---|---|
callback |
A Function to be invoked when a package is deactivated. |
Return Values |
---|
Returns a {Disposable} on which |
onDidLoadPackage(callback)
Invoke the given callback when a package is loaded.
Argument | Description |
---|---|
callback |
A Function to be invoked when a package is loaded. |
Return Values |
---|
Returns a {Disposable} on which |
onDidUnloadPackage(callback)
Invoke the given callback when a package is unloaded.
Argument | Description |
---|---|
callback |
A Function to be invoked when a package is unloaded. |
Return Values |
---|
Returns a {Disposable} on which |
getApmPath()
Get the path to the apm command.
Return a String file path to apm.
getPackageDirPaths()
Get the paths being used to look for packages.
Return Values |
---|
resolvePackagePath(name)
Resolve the given package name to a path on disk.
Return a String folder path or undefined if it could not be resolved.
Argument | Description |
---|---|
name |
The String package name. |
isBundledPackage(name)
Is the package with the given name bundled with Atom?
Argument | Description |
---|---|
name |
The String package name. |
Return Values |
---|
Returns a Boolean. |
enablePackage()
Enable the package with the given name.
Return Values |
---|
Returns the {Package} that was enabled or null if it isn't loaded. |
disablePackage()
Disable the package with the given name.
Return Values |
---|
Returns the {Package} that was disabled or null if it isn't loaded. |
isPackageDisabled(name)
Is the package with the given name disabled?
Argument | Description |
---|---|
name |
The String package name. |
Return Values |
---|
Returns a Boolean. |
getActivePackages()
Get an Array of all the active {Package}s.
getActivePackage(name)
Get the active {Package} with the given name.
Argument | Description |
---|---|
name |
The String package name. |
Return Values |
---|
Returns a {Package} or . |
isPackageActive(name)
Is the {Package} with the given name active?
Argument | Description |
---|---|
name |
The String package name. |
Return Values |
---|
Returns a Boolean. |
getLoadedPackages()
Get an Array of all the loaded {Package}s
getLoadedPackage(name)
Get the loaded {Package} with the given name.
Argument | Description |
---|---|
name |
The String package name. |
Return Values |
---|
Returns a {Package} or . |
isPackageLoaded(name)
Is the package with the given name loaded?
Argument | Description |
---|---|
name |
The String package name. |
Return Values |
---|
Returns a Boolean. |
getAvailablePackagePaths()
Get an Array of Strings of all the available package paths.
If the optional windowType is passed, it will only load packages that declare that windowType in their package.json