Qilin package manager
qilin-manager is a simple and minimal package manager which allows you to install plugins and themes for Qilin. Packages are downloaded and prepared from GitHub.
Installation
$ npm install qilin-manager
Usage
; const qpm = ;
Installing packages
qpm.install(package: string, namespace?: string): Promise
Asynchronously installs a specified package from GitHub. Once downloaded, the package is extracted in dest
directory and properly prepared: its dependencies are downloaded by NPM and build scripts are launched.
Example:
Promiseall qpm qpm qpm;
Listing packages
qpm.list(namespace?: string): Promise
Asynchronously returns a list of installed packages in dest
directory under a given namespace. The returned list is an object whose keys correspond to packages names and values are objects containing:
namespace
: plugin namespace;directory
: plugin parent directory;version
: same as inpackage.json
;package
: full path topackage.json
;
Example:
const all = await qpm;const themes = await qpm;const plugins = await qpm;
Example output:
Updating packages
qpm.update(namespace?: string): Promise
Asynchronously checks if locally installed packages under a certain namespace are up-to-date. If no, they are downloaded again.
Example:
qpm;qpm;qpm;
Loading a package
qpm.load(package: string, namespace?: string): Promise
Asynchronously loads then executes a script in a virtual machine (V8 sandbox) and returns it's module.exports
back to the client. All the dependencies are resolved automatically.
Example:
const MyPlugin = await qpm;const instance = …;
Searching for packages
qpm.search(organization: string, filter?: string): Promise
Asynchronously searches a GitHub organization for repositories matching a specified filter.
Example:
const plugins = await qpm;const themes = await qpm;
Example output:
Refer to GitHub API.
Building a package
Note: packages are built automatically once installed using
qpm.install
.
Installs dependencies for a given package and executes several NPM scripts in order to build the plugin. Scripts are executes in the order below:
preinstall
;install
;postinstall
;prepare
;
Example:
qpm;qpm;
Configuration
You can configure qilin-manager
using environment variables.
Variable | Description | Default |
---|---|---|
DEBUG=qilin:* |
Outputs debug informations in terminal | undefined |
QPM_HOME |
Destination path for downloaded packages | HOME/.qpm/ |
QPM_PROXY |
Custom proxy settings | undefined |