zyhm
v2.0.0
Published
WHM (Web Host Manager) API 1 Wrapper for NodeJS
Downloads
15
Readme
zyhm
This is a library that allows you to remotely control your web hosting server that is running cPanel for personal or bot use.
Recoded and fixing outlog from : @ihadeed/node-whm
Instalation
npm i zyhm
Usage JavaScript
var ZYHM = require('zyhm');
var ZYHMClient = new ZYHM.Client({
serverUrl: 'https://myserver.com:2087',
remoteAccessKey: 'remoteAccessKeyHere',
username: 'resellerOrRootUser'
});
ZYHMClient.createAccount({
username: 'myuser',
password: 'mySecurePassword!',
plan: 'Pro',
domain: 'clientdomain.com'
}).then(
function(success){
console.log(success);
// do something with data
},
function(error) {
console.error(error);
// do something with data
}
);
Usage Typescript
import { Client, ZYHMOptions } from 'zyhm';
const ZYHMClientOptions: ZYHMOptions = {
serverUrl: 'https://myserver.com:2087',
remoteAccessKey: 'remoteAccessKeyHere',
username: 'resellerOrRootUser'
};
const client: Client = new Client(ZYHMClientOptions);
client.createAccount({
username: 'myuser',
password: 'mySecurePassword!',
plan: 'Pro',
domain: 'clientdomain.com'
}).then(
success => {
console.log(success);
// do something with data
},
error => {
console.error(error);
// do something with data
}
);