Socket
Socket
Sign inDemoInstall

cpanel-uapi

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cpanel-uapi

A javascript/typescript library for the CPanel API.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

HPanel

An unofficial CPanel client for the Node runtime ( TypeScript / JavaScript).

At the moment, this project only supports the UAPI API.

Installation

npm install cpanel-uapi

Usage

TypeScript:

// In this example, we are going to be using the Email module. All of UAPI's modules are available, however.
import hpanel, { Email } from 'hpanel';

// Authorize via. API Token
hpanel({
  // For security, it is best if these credentials are implemented via a .env file.
  username: 'my-cpanel-username',
  token: 'ABCDEFGH...',
  cpanelUri: 'https://mypanel.example.com:2083/'
});

// Begin to use UAPI's modules and functions!
(async () => {
  const data = await Email.listpops();
  // ... do something.
  await Email.deletefilter({
    account: 'haticus@example.com',
    filtername: 'coffee'
  });
  // etc.
})();

// That's it!

JavaScript:

// In this example, we are going to be using the Email module. All of UAPI's modules are available, however.
const hpanel = require('hpanel');

// Authorize via. API Token
hpanel.default({
  // For security, it is best if these credentials are implemented via a .env file.
  username: 'my-cpanel-username',
  token: 'ABCDEFGH...',
  cpanelUri: 'https://mypanel.example.com:2083/'
});

// Begin to use UAPI's modules and functions!
(async () => {
  const data = await hpanel.Email.listpops();
  // ... do something.
  await hpanel.Email.deletefilter({
    account: 'haticus@example.com',
    filtername: 'coffee'
  });
  // etc.
})();

// That's it!

Contributing to HPanel

If you have a feature you'd like to add to HPanel, feel free to fork this repository and submit a pull request with details about the work you completed. At the moment, we are not officially supporting this repository and will default all issues to the community. As appropriate, we will update this repository now and then. Pull requests, however, will be looked at as soon as they arrive.

Keywords

FAQs

Last updated on 13 Jul 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