JSPM

fetchdactyl

1.0.1-beta.3
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q8994F
    • License MIT

    A Node.js wrapper for the Pterodactyl API, providing client and application services.

    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-dactyl

    Usage

    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

    1. Clone: git clone https://github.com/your-repo/fetch-dactyl.git
    2. Install: npm install
    3. Build: npm run build
    4. Test: npm test

    License

    MIT