rpc-supervisor
v1.1.6
Published
XML-RPC based client interface for Supervisor.
Downloads
9
Maintainers
Readme
What is it?
A Javascript implementation of the Supervisor XML-RPC API.
It simply exposes API methods natively and accessible to Javascript and was built using typescript.
Installation
Can be installed by npm:
npm install rpc-supervisor
Usage
Following the supervisor documentation (which can be found here), I separated the APIs into two objects: SupervisorApi
and SystemApi
.
Important: All methods return a promise of their own type.
And for that, each one has its own factory. Example:
const {createSupervisorApi} = require('rpc-supervisor');
(async () => {
const supervisorApi = createSupervisorApi({
host: 'localhost',
port: 9005,
username: 'user',
password: '123',
path: '/RPC2', // Default path for supervisor configuration.
});
const result = await supervisorApi.getVersion();
console.log(result);
})();
Factories Availabe
createSupervisorApi
- Returns theSupervisorApi
object. Which is the representation of the prefix "supervisor".createSystemApi
- Returns theSystemApi
object. Which is the representation of the prefix "system".
The License (MIT)
Released under the MIT license. See the LICENSE file for the complete wording. Contributors
Contributors
Thank you to all the authors and everyone who has filed an issue to help make xmlrpc better.