cpanel-lib

Node.js library for the cPanel/WHM API

Node.js library for the cPanel/WHM API

$ npm install cpanel-lib
var cpanel = require('cpanel-lib');

var options = {
  host: 'whm.example.com',
  port: 2087,
  secure: true,
  username: 'WHM_USERNAME',
  accessKey: 'YOUR_ACCESS_KEY'
};

var cpanelClient = cpanel.createClient(options);

cpanelClient.call('version', {}, function (result) {
  console.log('WHM Version: %j', result.version);
});

cpanelClient.call('listaccts', {}, function (result) {
  console.log('Result: %j', result);
});