# zyhm

> WHM (Web Host Manager) API 1 Wrapper for NodeJS

Latest version **2.0.0** (published 2022-12-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install zyhm
pnpm add zyhm
yarn add zyhm
bun add zyhm
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-12-03 |
| First published | 2022-11-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 143.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Ditzzy |
| Maintainers | ditzzsenpai |
| Keywords | Zyhm |

## Links

- npm: https://www.npmjs.com/package/zyhm
- Repository: https://github.com/wffzy/zyhm
- Homepage: https://github.com/wffzy/zyhm#readme
- Issues: https://github.com/wffzy/zyhm/issues
- npm.io page: https://npm.io/package/zyhm

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.2
- [request](https://npm.io/package/request.md) ^2.79.0
- [@ptkdev/logger](https://npm.io/package/@ptkdev/logger.md) ^1.8.0

## Recent versions

- 2.0.0 (latest) — 2022-12-03
- 1.9.0 — 2022-12-03
- 1.8.0 — 2022-12-03
- 1.7.0 — 2022-12-03
- 1.6.0 — 2022-12-03
- 1.5.0 — 2022-11-14
- 1.4.0 — 2022-11-14
- 1.3.0 — 2022-11-14
- 1.2.0 — 2022-11-14
- 1.1.0 — 2022-11-14

## 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.</br>
Recoded and fixing outlog from : [`@ihadeed/node-whm`](https://github.com/ihadeed/node-whm)


### Instalation

```bash
npm i zyhm
```

### Usage JavaScript

```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
```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
           }
       );
```
## Methods Calling Function

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


## Interfaces _`TypeScript`_

#### `WHMOoptions`
#### `CreateAccountOptions`
#### `AccountData`

---
_Source: https://npm.io/package/zyhm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
