npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ho3einwave/pelican-ts

v0.3.4

Published

Type-safe TypeScript library for the Pelican Panel API. Covers Client API, Application API, and WebSocket API with zero dependencies.

Downloads

626

Readme

pelican-ts

CI npm License: MIT

Type-safe TypeScript library for the Pelican Panel API. Zero dependencies.

  • Client API (PelicanClient) - Account, servers, files, databases, backups, schedules, network, subusers
  • Application API (PelicanApplication) - Users, servers, nodes, eggs, database hosts, mounts, roles (admin)
  • WebSocket API (WebSocketManager) - Real-time console, stats, status with auto-reconnect

Install

npm install @ho3einwave/pelican-ts

Quick Start

Client API

The Client API uses a client API key (prefix ptlc_) and gives access to the user-facing endpoints: account management, server operations, files, databases, backups, schedules, etc.

import { PelicanClient } from '@ho3einwave/pelican-ts';

const client = new PelicanClient({
  baseUrl: 'https://panel.example.com',
  apiKey: 'ptlc_...',
});

// Account
const account = await client.account.getDetails();

// List servers
const { data: servers } = await client.servers.list();

// Server-scoped operations
const srv = client.server('abc123');

await srv.sendCommand('say Hello!');
await srv.setPowerState('restart');

const resources = await srv.getResources();
console.log(`Memory: ${resources.resources.memory_bytes}`);

// Files
const files = await srv.files.list('/');
const content = await srv.files.getContent('/server.properties');
await srv.files.writeFile('/motd.txt', 'Welcome!');

// Backups
const { data: backups } = await srv.backups.list();
const backup = await srv.backups.create({ name: 'before-update' });

// Databases
const dbs = await srv.databases.list();
const newDb = await srv.databases.create({ database: 'mydb', remote: '%' });

// Schedules
const schedules = await srv.schedules.list();

// Permissions
const permissions = await client.getPermissions();

Application API

The Application API uses an application API key (prefix ptla_) and provides admin-level access: managing users, servers, nodes, eggs, database hosts, mounts, and roles.

import { PelicanApplication } from '@ho3einwave/pelican-ts';

const app = new PelicanApplication({
  baseUrl: 'https://panel.example.com',
  apiKey: 'ptla_...',
});

// Users
const { data: users } = await app.users.list();
const user = await app.users.create({
  email: '[email protected]',
  username: 'newuser',
});

// Servers
const { data: servers } = await app.servers.list();
await app.servers.suspend(1);
await app.servers.unsuspend(1);

// Nodes
const { data: nodes } = await app.nodes.list();

// Eggs (top-level in Pelican)
const { data: eggs } = await app.eggs.list();

// Database Hosts
const { data: dbHosts } = await app.databaseHosts.list();

// Mounts
const { data: mounts } = await app.mounts.list();

// Roles
const { data: roles } = await app.roles.list();

WebSocket

import { PelicanClient, WebSocketManager } from '@ho3einwave/pelican-ts';

const client = new PelicanClient({
  baseUrl: 'https://panel.example.com',
  apiKey: 'ptlc_...',
});

const srv = client.server('abc123');
const creds = await srv.getWebSocketCredentials();

const ws = new WebSocketManager({
  origin: creds.socket,
  serverUuid: 'full-server-uuid',
  getToken: async () => {
    const c = await srv.getWebSocketCredentials();
    return c.token;
  },
});

ws.on('console output', (line) => console.log(line));
ws.on('status', (status) => console.log('Status:', status));
ws.on('stats', (stats) => console.log('CPU:', stats.cpu_absolute));

await ws.connect();

ws.sendCommand('say Hello from API!');
ws.sendPowerAction('restart');

// Later
ws.disconnect();

Error Handling

import { PelicanError, PelicanValidationError, PelicanRateLimitError } from '@ho3einwave/pelican-ts';

try {
  await app.users.create({
    /* ... */
  });
} catch (err) {
  if (err instanceof PelicanValidationError) {
    console.log(err.fieldErrors); // { email: ['Must be valid email.'] }
  } else if (err instanceof PelicanRateLimitError) {
    console.log(`Retry after ${err.retryAfter}s`);
  } else if (err instanceof PelicanError) {
    console.log(err.status, err.code, err.message);
  }
}

Pagination & Filtering

const { data, pagination } = await app.servers.list({
  page: 2,
  perPage: 25,
  sort: '-id',
  filters: { name: 'minecraft' },
  include: ['allocations', 'user'],
});

console.log(`Page ${pagination.currentPage} of ${pagination.totalPages}`);

API Reference

See API.md for the full API reference with all managers, methods, types, and parameters.

License

MIT