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

oxfd.js

v1.3.0

Published

JavaScript API wrapper for the OXFD API with Discord.js helpers, permissions, and rate-limit handling

Readme

Oxfd.js

The first JavaScript API Wrapper for the Oxford Response API. Currently in V1.0.0, it features all available API Endpoints.

Installation

Install using npm:

npm install oxfd.js

or

npm i oxfd.js

🛠️ Usage

// Import the main Wrapper from the NPM Package
import OXFDClient from "oxfd.js";

// Use this if you use CommonJS
const OXFDClient = require("oxfd.js");

//Initialize with your servers API Key
const api = new OXFDClient("ADD YOUR API KEY HERE");

(async () => {
  try {
    //Retrieve basic server info
    const serverInfo = await api.getServerInfo();
    console.log("Server Info:", serverInfo);

    //Retrieve basic player info
    const players = await api.getPlayers();

    //Retrieve basic Queue info
    const queue = await api.getQueue();

    //Retrieve basic ban info
    const bans = await api.getBans();

    //Retrieve Killlogs
    const kl = await api.getKillLogs();

    //Retrieve Command Logs
    const cmdl = await api.getCommandLogs();

    //Retrieve Modcalls
    const modcalls = await api.getModCalls();

    //Execute a command
    const cmd = await api.executeCommand("announce Hello, Oxford RP!");

  } catch (err) {
    console.error("API Error:", err);
  }
})();

⚙️ Advanced Config

//Only recommended for those who really know what they are doing

//Default API Import (recommended for beginners)
const api = new OXFDClient("YOUR SERVERS API KEY");

// Bring in rate limits (recommended if you have heavy command usage)
const strictAPI = new OXFDClient("YOUR API KEY SHOULD BE HERE", {
  maxRetries: 5,      // Retry up to 5 times on API 429 Errors
  timeout: 10000      // Request timeout in ms
});

//Disable rate limiting (Use with caution and only if you really know whyt you are doing)
const noRateLimitAPI = new OXFDClient("YOUR API KEY SHOULD BE HERE", {
  maxRetries: ,
});

Using Managers

  // Import Package using ESM
  import OXFDClient from 'oxfd.js';
  
  // Import package using CommonJS
  const OXFDClient = require("oxfd.js");

  const api = new OXFDClient("YOUR API KEY");

  //Directly access Data via their manager
  const serverInfo = await api.servers.getServer();
  const killLogs = await api.logs.getKillLogs();
  await api.commands.executeCommand("announce Hiya!");

General Functions and how they are parented/managed


Server {
  getServerInfo()      // Get Information about the server
  getPlayers()         // Get Information about the Players
  getQueue()           // Get Information about the queue
  getBans()            // Get the bans
  getVehicles()        // Get vehicle information
  getRobberies()       // Get informations about the Robbery Locations
}

Logs {
  getKillLogs()        // Get killlogs
  getCommandLogs()     // Get Command logs
  getModCalls()        // Get ModCalls
  getRadioCalls()      // Get Radio Calls
  getJoinLogs()        // Get Join Logs
}

Commands {
  executeCommand(command)   // Execute a command, command input is required tho
}

Error Handling

//ESM
  import OXFDClient from "oxfd.js";

// CommonJS
  const OXFDClient = require("oxfd-api");

  const api = new OXFDClient("YOUR API KEY");

  (async () => {
  try {
    // Attempt to get server info
    const serverInfo = await api.getServerInfo();
    console.log("Server Info:", serverInfo);

  } catch (err) {
    // Check if the error is due to hitting the rate limit (HTTP 429)
    if (err.message.includes("429")) {
      console.log("⚠️ Rate limit exceeded. Wait a few seconds and retry.");
    }
    // Check if the request was aborted (timeout)
    else if (err.message.includes("The operation was aborted")) {
      console.log("⚠️ Request timed out. Try again later.");
    }
    // Catch-all for any other API errors (non-2xx responses, invalid server key, etc.)
    else {
      console.error("❌ API Error:", err);
    }
  }
})();

Rate limit handling

The wrapper automatically retries 429 errors up to 3 times, or maxRetries depending on your usage type. To manuallyadjust your maxRetries variable for error handling, use the following API Initialisation:

const api = new OXFDClient("YOUR_KEY", { maxRetries: 5 });

Timeout handling

The default request timeout is set to 10 seconds. If you would like to increase/decrease it, use the following code: ⚠️ IMPORTANT ⚠️ Timeout needs to be formatted in ms.

const api = new OXFDClient("YOUR_KEY", { timeout: 15000 });

General API errors

Any response with a non-2xx status code will automatically throw any error in the console. Example: invalid server key, missing endpoint, etc.

Networking/Abortion Errors

Includes network issues, invalid URLs, or request aborted due to timeout

API Response

You can find the output of every endpoint here