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

@erlcjs/core

v1.4.1

Published

ERLC API Wrapper Core

Readme

@erlcjs/core

npm version npm downloads bundle size TypeScript license

@erlcjs/core is a lightweight, fully-featured, and strongly-typed API wrapper for Roblox's Emergency Response: Liberty County (ER:LC) private servers. It handles the low-level API mechanics, caching, and rate limiting so you can focus on building server integrations, moderation tools, and dashboards.

Features

  • TypeScript Native: Written completely in TypeScript with comprehensive declarations.
  • Automatic Rate Limiting: Built-in REST client queues API commands and handles rate limit resets.
  • Real-time Event Emitters: Track game updates using high-frequency Polling or Webhook Gateway modes.
  • Entity Cache: Caches player states, spawned vehicles, active emergency calls, kill logs, and mod calls automatically.
  • Console Commands: Easily trigger commands like :kick, :kill, :pm directly through JS/TS methods.

Prerequisites

  • Node.js V16.0.0 or higher or Bun V1.0.0 or higher.
  • A valid ER:LC Private Server API Key.

Installation

Install @erlcjs/core in your project:

npm install @erlcjs/core
# or
pnpm add @erlcjs/core
# or
yarn add @erlcjs/core

Quick Start

Polling Mode

Polling is the simplest way to get started. It queries the ER:LC HTTP API every 5 seconds to fetch server changes.

import { Client, ERLCEvents } from '@erlcjs/core';

const client = new Client({
  serverKey: 'YOUR_ERLC_SERVER_API_KEY',
  polling: true
});

client.on(ERLCEvents.playerJoin, (player) => {
  console.log(`Player joined: ${player.username} (ID: ${player.id})`);
  
  // Send a welcome message in-game
  player.message('Welcome to our server!');
});

client.on(ERLCEvents.kill, (killLog) => {
  console.log(`${killLog.killerUsername} killed ${killLog.killedUsername}`);
});

client.on(ERLCEvents.emergencyCallAdd, (call) => {
  console.log(`Emergency Call #${call.callNumber}: ${call.description}`);
});

Webhook Gateway Mode (Alpha)

Set up a local server to receive real-time webhook events pushed directly by ER:LC.

import { Client, ERLCEvents } from '@erlcjs/core';

const client = new Client({
  serverKey: 'YOUR_ERLC_SERVER_API_KEY',
  globalKey: 'YOUR_PUBLIC_APP_GLOBAL_KEY',
  globalAppId: 'YOUR_PUBLIC_APP_ID', 
  webhook: {
    enabled: true,
    port: 3000,
    path: '/events-webhook'
  }
});

client.on(ERLCEvents.playerJoin, (player) => {
  console.log(`${player.username} joined via gateway webhook!`);
});

Core Structure Methods

The wrapper resolves entities into structures representing in-game components.

Players

Retrieve cached players, or issue immediate actions:

const player = client.players.cache.get(1234567); // get by UserId

// Kick a player
await player.kick('Violating server rules');

// Kill a player
await player.kill();

// Message a player
await player.message('Please review the rules');

Vehicles

Retrieve vehicle details:

const vehicle = client.vehicles.cache.get('PLATE_ABC_123');
console.log(`Vehicle model: ${vehicle.name}, Owner: ${vehicle.ownerUsername}`);

Executing Commands

Issue custom commands directly:

await client.commands.execute(':heal user');

Custom Commands

Registering custom commands:

client.registerCommand({
    name: 'example',
    aliases: [ 'ping' ],
    execute: async ({ player, args }) => {
        await player.message(`Pong! Args: ${args.join(' ')}`)
    }
})

Now when the user messages ;ping test in-game, it will respond with Pong! Args: test.

Getting Your Authorization Link

For public apps where authorizing the IP manually is not ideal:

console.log(client.authorizationLink);

Documentation

To read the complete API Reference and detailed guides, view the documentation site: erlc.js Documentation Portal

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

Distributed under the Apache-2.0 License. See LICENSE for more information.