Socket
Socket
Sign inDemoInstall

dz-node-whm

Package Overview
Dependencies
48
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dz-node-whm

a WHM API 1 for NodeJS


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

dz-node-whm

WHM API 1 for NodeJS

This is a library that allows you to remotely control your web hosting server that is running cPanel.

This library is built for personal use. If you would like to use it and there is a missing feature, please submit an issue on the Github repo and I will do my best to add it ASAP.

To build this, run tsc at the root directory. Or install via npm npm install dz-node-whm

Usage

JavaScript

var WHM = require('dz-node-whm');
var whmClient = new WHM.Client({
    serverUrl: 'https://myserver.com:2087',
    remoteAccessKey: 'remoteAccessKeyHere',
    username: 'resellerOrRootUser'
});

whmClient.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
    }
);

Typescript

import { Client, WHMOptions } from 'dz-node-whm';

const whmClientOptions: WHMOptions = {
   serverUrl: 'https://myserver.com:2087',
   remoteAccessKey: 'remoteAccessKeyHere',
   username: 'resellerOrRootUser'
};

const client: Client = new Client(whmClientOptions);

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
           }
       );

Methods

createAccount(options: CreateAccountOptions): Promise<any>
terminateAccount(user: string): Promise<any>
listAccounts(): Promise<AccountData[]>
listIPAddresses(): Promise<any>

Interfaces TypeScript

WHMOoptions
CreateAccountOptions
AccountData

Keywords

FAQs

Last updated on 12 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc