Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ihadeed/node-whm
WHM API 1 Wrapper for NodeJS Applications
https://github.com/ihadeed/node-whm
Last synced: 13 days ago
JSON representation
WHM API 1 Wrapper for NodeJS Applications
- Host: GitHub
- URL: https://github.com/ihadeed/node-whm
- Owner: ihadeed
- Created: 2016-06-11T15:19:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T18:58:34.000Z (about 8 years ago)
- Last Synced: 2024-11-25T03:28:10.028Z (about 1 month ago)
- Language: TypeScript
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-whm
WHM (Web Host Manager) API 1 Wrapper for NodeJSThis 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 node-whm`
## Usage
### JavaScript
```javascript
var WHM = require('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
```typescript
import { Client, WHMOptions } from '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`
#### `terminateAccount(user: string): Promise`
#### `listAccounts(): Promise`
#### `listIPAddresses(): Promise`
## Interfaces _`TypeScript`_
#### `WHMOoptions`
#### `CreateAccountOptions`
#### `AccountData`