The [Cloud9 Installer](πŸ”—ο»Ώ) can be extended with custom package managers that add a new way to install a package or manipulate the workspace.

A package manager is a simple plugin with an `execute()` method that takes a task argument and an options object.

In the example below the first object is the options object and in this case the `npm` package manager gets its `execute()` method called with "[sequelize@2.0.0-beta.0](πŸ”—ο»Ώ)" as its task.

ο»Ώ

In the following example there are multiple items for the `npm` package manager. However, the `execute()` method will be called once for each.

ο»Ώ

# Creating a Package Manager

A basic package manager starts with the following template.

ο»Ώ

# isAvailable

The `isAvailable()` method is called by the installer to confirm that this package manager is available on the workspace that it is run on. An implementor _must_ cache the result of this function.

The following example is taken from the `ubuntu` package manager. It checks whether `apt-get` is installed on the system and caches the result in the `available` variable.

ο»Ώ

# execute

As already mentioned above, the `execute()` method executes a single task. It takes four arguments. The `task` contains the string or object that describes the single task to execute. The `options` object contains any options specified by the user. The `onData` function _should_ be called to stream any data that can be outputted in the installation log. Lastly the `callback` _must_ be called when execution is stopped, either successfully or not.

The following example is again from the `ubuntu` package manager. As you can see below, the package manager _should_ use `proc.pty` to start processes if they are long running.

ο»Ώ

ο»Ώ