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

erlc-api

v3.3.1

Published

An ER:LC API wrapper for JS/TS

Readme

🚔 ER:LC API Wrapper

npm version License Downloads

🇪🇸 Versión en Español

A lightweight, complete, and fully typed library for interacting with the Emergency Response: Liberty County (ER:LC) API. Designed to provide the best development experience in both JavaScript and TypeScript.


✨ Features

  • 🎯 Full Coverage: Support for 100% of the API v1 endpoints.
  • 🛡️ TypeScript Support: Native type definitions included.
  • Lightweight & Fast: No unnecessary heavy dependencies.
  • 🔒 Secure: Robust token validation and error handling.
  • 🆕 Up-to-date: Support for optional GlobalToken (v3.2.0+).

📦 Installation

npm install erlc-api
# or
bun add erlc-api

🚀 Quick Start

Initialization

You can use the library with or without a Global Token (required only for large-scale applications).

JavaScript

const erlc = require("erlc-api");

// Simple initialization (Recommended for most users)
const client = new erlc.Client();

// Or with Global Token (For Large Apps)
// const client = new erlc.Client({ globalToken: "..." });

TypeScript

import { Client, getServer } from "erlc-api";

const client = new Client();

📖 Usage Examples

Make sure to have your Server Key ready (get it from your private server settings in ER:LC).

🖥️ Server Information

const serverToken = "your-server-key-here";

// Get server status
const server = await erlc.getServer(serverToken);
console.log(`Server: ${server.Name} | Players: ${server.CurrentPlayers}/${server.MaxPlayers}`);

// Get connected players
const players = await erlc.getPlayers(serverToken);
console.table(players); // Shows name, ID, permission, and team

// Get vehicles on the map
const vehicles = await erlc.getVehicles(serverToken);

📜 Logs

Access your server's activity history:

// Join/Leave Logs
const joinLogs = await erlc.getJoinLogs(serverToken);

// Kill Logs (Killfeed)
const killLogs = await erlc.getKillLogs(serverToken);

// Command Logs
const commandLogs = await erlc.getCommandLogs(serverToken);

// Mod Call Logs
const modCalls = await erlc.getModcallLogs(serverToken);

🛠️ Management & Administration

// Get Ban List
const bans = await erlc.getBans(serverToken);

// Get Server Staff
const staff = await erlc.getStaff(serverToken);

// Get Queue
const queue = await erlc.getQueue(serverToken);

⚡ Run Command

Execute commands directly from your code:

const command = await erlc.runCommand(serverToken, ":announce This is an API test!");
console.log(command); // Returns true if successful

⚠️ Error Handling

The library throws descriptive errors. You should wrap your calls in try/catch blocks.

try {
  const data = await erlc.getServer("invalid-token");
} catch (error) {
  console.error(error.message); // e.g., "Forbidden: Access denied..."
}

| Error Code | Description | |------------|-------------| | 401 | Unauthorized (Invalid Token) | | 403 | Forbidden (Permissions issue) | | 429 | Rate Limit Exceeded | | 500 | Internal Server Error |


🤝 Contributing

Contributions are welcome! Feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License.