https://github.com/pteropackages/pterojslite
A lightweight alternative to PteroJS
https://github.com/pteropackages/pterojslite
api javascript pterodactyl pterodactyl-api pterojs pterojslite typescript wrapper
Last synced: 11 months ago
JSON representation
A lightweight alternative to PteroJS
- Host: GitHub
- URL: https://github.com/pteropackages/pterojslite
- Owner: PteroPackages
- License: mit
- Created: 2022-02-08T00:05:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-30T16:52:31.000Z (over 3 years ago)
- Last Synced: 2025-04-20T00:12:19.603Z (about 1 year ago)
- Topics: api, javascript, pterodactyl, pterodactyl-api, pterojs, pterojslite, typescript, wrapper
- Language: TypeScript
- Homepage:
- Size: 107 KB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
PteroJSLite
A lightweight alternative to PteroJS
## About
PteroJSLite is a lightweight alternative to [PteroJS](https://github.com/PteroPackages/PteroJS) using only objects and functions - absolutely no classes! This package is ideal if you want a high-level package without the abstractions and helper methods of larger libraries, while still getting same amount of functionality.
## Installing
You must have NodeJS v14 or above to use this package.
```
npm install @devnote-dev/pterojslite
yarn add @devnote-dev/pterojslite
```
## Compatibility
PteroJSLite supports version 1.7+ of the panel, and version 1.6+ of Wings.
## Getting Started
Application and Client API instances can be created using the `createApp` and `createClient` functions respectively. Both application keys (`ptla`) and client keys (`ptlc`) are currently supported.
```js
const { createApp } = require('@devnote-dev/pterojslite');
const app = createApp('https://your.panel.domain', 'ptla_your_api_key');
app.getServers().then(console.log);
(async () => {
const users = await app.getUsers(); // returns an array of user objects
console.log(users.filter(u => u.rootAdmin)); // filters out non-admin users
})();
```
```js
const { createClient } = require('@devnote-dev/pterojslite');
const client = createClient('https://your.panel.domain', 'ptlc_your_api_key');
client.getAccount().then(console.log);
(async () => {
const activities = await app.getActivities(); // returns an array of activity logs
console.log(activities.filter(a => a.isAPI)); // filters out non-API activities
})();
```
## Contributing
Please [create an issue](https://github.com/PteroPackages/PteroJSLite/issues) for issues or feature requests for the package.
1. [Fork this repo](https://github.com/PteroPackages/PteroJSLite/fork)!
2. Make a branch from `main` (`git branch -b `)
3. Commit your changes (`git commit -am "..."`)
4. Open a PR here (`git push origin `)
## Contributors
- [Devonte](https://github.com/devnote-dev) - Owner, maintainer
- [Tlkh40](https://github.com/tlkh40) - Code contributor
This repository is managed under the MIT license.
© 2021-present PteroPackages