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

@korabi-dev/erlc-api

v1.0.0

Published

Unofficial ER:LC API wrapper for Node.js/TypeScript

Downloads

11

Readme

ERLC API

This project provides an ER:LC API Wrapper built with TypeScript. Below are the main details and usage instructions.

Getting Started

Prerequisites

Usage

TypeScript

import ErlcClient from '@korabi-dev/erlc-api';

const client = new ErlcClient({ serverKey: 'YOUR_SERVER_KEY' });

// Fetch server status
const status = await client.fetchServerStatus();
if (!status.error) {
	console.log('Server status:', status.data);
}

// Fetch all players
const players = await client.fetchPlayers();
if (!players.error) {
	console.log('Players:', players.data);
}

// Send a message to the server
const result = await client.sendMessage('Hello, ER:LC!');
if (result.error) {
	console.error('Failed to send message:', result.message);
}

JavaScript (CommonJS)

const ErlcClient = require('@korabi-dev/erlc-api').default;

const client = new ErlcClient({ serverKey: 'YOUR_SERVER_KEY' });

(async () => {
	// Fetch server status
	const status = await client.fetchServerStatus();
	if (!status.error) {
		console.log('Server status:', status.data);
	}

	// Fetch all players
	const players = await client.fetchPlayers();
	if (!players.error) {
		console.log('Players:', players.data);
	}

	// Send a message to the server
	const result = await client.sendMessage('Hello, ER:LC!');
	if (result.error) {
		console.error('Failed to send message:', result.message);
	}
})();

API Reference

All methods are asynchronous and return an object with at least:

  • error: boolean
  • message: string (if error)
  • data: varies by method

Methods

fetchServerStatus()

Returns server status info:

{
	error: boolean,
	message?: string,
	data?: {
		Name: string,
		OwnerId: number,
		CoOwnerIds: number[],
		CurrentPlayers: number,
		MaxPlayers: number,
		JoinKey: string,
		AccVerifiedReq: "Disabled" | "Email" | "Phone/ID",
		TeamBalance: boolean
	}
}

fetchPlayers()

Returns array of players:

{
	error: boolean,
	message?: string,
	data?: Array<{
		UserId: number,
		Username: string,
		Permission: "Normal" | "Server Administrator" | "Server Owner" | "Server Moderator",
		Callsign?: string,
		Team: string
	}>
}

fetchJoinLogs()

Returns array of join logs:

{
	error: boolean,
	message?: string,
	data?: Array<{
		Join: boolean, // this indicates a join or leave event, Join=true means the user joined, Join=false means the user left
		Timestamp: number,
		Username: string,
		UserId: number
	}>
}

fetchPlayerQueue()

Returns array of user IDs in queue:

{
	error: boolean,
	message?: string,
	data?: Number[] // this is an array of roblox userIDs
}

fetchKillLogs()

Returns array of kill logs:

{
	error: boolean,
	message?: string,
	data?: Array<{
		KillerUsername: string,
		KillerUserId: number,
		VictimUsername: string,
		VictimUserId: number,
		Timestamp: number
	}>
}

fetchCommandLogs()

Returns array of command logs:

{
	error: boolean,
	message?: string,
	data?: Array<{
		Username: string,
		UserId: number,
		Command: string,
		Timestamp: number
	}>
}

fetchModCalls()

Returns array of mod calls:

{
	error: boolean,
	message?: string,
	data?: Array<{
		CallerUsername: string,
		CallerUserId: number,
		ModeratorUsername?: string,
		ModeratorUserId?: number,
		Timestamp: number
	}>
}

fetchBans()

Returns array of banned player IDs:

{
	error: boolean,
	message?: string,
	data?: Array<{ PlayerId: string }>
}

fetchSpawnedVehicles()

Returns array of vehicles:

{
	error: boolean,
	message?: string,
	data?: Array<{ Name: string, Texture: string, Owner: string }>
}

fetchStaff()

Returns array of staff players:

{
	error: boolean,
	message?: string,
	data?: Array<{ UserId: number, Username: string, Permission: string }>
}

fetchFilteredModCalls(options)

Returns filtered mod calls (see fetchModCalls for structure).

fetchFilteredKillLogs(options)

Returns filtered kill logs (see fetchKillLogs for structure).

fetchFilteredJoinLogs(options)

Returns filtered join logs (see fetchJoinLogs for structure).

fetchFilteredCommandLogs(options)

Returns filtered command logs (see fetchCommandLogs for structure).

fetchPlayer(options)

Returns a single player object (see fetchPlayers for structure).

isBanned(userId)

Returns banned status:

{
	error: boolean,
	message?: string,
	data?: { banned: boolean }
}

sendMessage(message)

Sends a message to the server. Returns error/message only.

sendHint(message)

Sends a hint to the server. Returns error/message only.

banPlayer(options)

Ban a player by userid or username. Returns error/message only.

kickPlayer(options)

Kick a player by userid or username. Returns error/message only.

Options Objects

Some methods accept an options object to filter or specify parameters. Here are the details for each:

fetchFilteredModCalls(options)

options can include:

  • timeframe (number, ms): Only calls within this time window (from now)
  • modid (number): Moderator's user ID
  • modusername (string): Moderator's username
  • callerid (string): Caller user ID
  • callerusername (string): Caller username At least one must be provided.

fetchFilteredKillLogs(options)

options can include:

  • timeframe (number, ms): Only logs within this time window
  • killerid (number): Killer's user ID
  • killerusername (string): Killer's username
  • victimid (number): Victim's user ID
  • victimusername (string): Victim's username At least one must be provided.

fetchFilteredJoinLogs(options)

options can include:

  • timeframe (number, ms): Only logs within this time window
  • userid (number): User ID
  • username (string): Username At least one must be provided.

fetchFilteredCommandLogs(options)

options can include:

  • timeframe (number, ms): Only logs within this time window
  • userid (number): User ID
  • username (string): Username At least one must be provided.

fetchPlayer(options)

options must include either:

  • userid (number): User ID
  • username (string): Username Only one should be provided.

banPlayer(options)

options must include:

  • userid (number): User ID, or
  • username (string): Username Only one should be provided.
  • reason (string): Reason for ban (required)
  • strict (boolean): If true, checks if ban succeeded (optional)

kickPlayer(options)

options must include:

  • userid (number): User ID, or
  • username (string): Username Only one should be provided.
  • reason (string): Reason for kick (required)
  • strict (boolean): If true, checks if kick succeeded (optional)