Package Exports
- fetchdactyl
- fetchdactyl/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fetchdactyl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
FetchDactyl
A Node.js wrapper for the Pterodactyl API, providing client and application services.
Installation
npm install fetch-dactylUsage
const FetchDactyl = require('fetch-dactyl');
const dactyl = new FetchDactyl('https://your-panel.com', 'your-api-key');
async function main() {
// Client: List servers with pagination
const servers = await dactyl.client.servers.list();
console.log(servers.items);
if (servers.hasMore) {
const next = await servers.fetchNext();
console.log(next.items);
}
// Application: Create user
const user = await dactyl.application.users.create({
email: 'test@example.com',
username: 'testuser',
first_name: 'Test',
last_name: 'User',
});
console.log(user);
// Console: Connect to server WebSocket
const console = await dactyl.client.servers.connectConsole('server-id', (data) => {
console.log('Console:', data);
});
console.send({ event: 'send command', args: ['say Hello'] });
}
main();Development
- Clone:
git clone https://github.com/your-repo/fetch-dactyl.git - Install:
npm install - Build:
npm run build - Test:
npm test
License
MIT