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 🙏

© 2025 – Pkg Stats / Ryan Hefner

lcinterface

v4.1.3

Published

An easy way to interact with the league client. This module is basically a middle layer between your app and the league client

Readme

League client interface

An easy way to interact with the league client. This module is basically a middle layer between your app and the league client

Documentation

Dependencies

Importing

$ npm install lcinterface
const { LCIConnector, LCIClient } = require("lcinterface")
const connector = new LCIConnector()

Getting client credentials

// optional
// the interval a wich lcinterface checks if the league of legends process is running (default is 1 sec/1000 ms)
connector.setCheckProcessInterval(1000)

// listen for event connect
connector.on("connect", (credentials) => {
  // do stuff with our client credentials

  // when you are done
  connector.disconnect()
})
// start the client connector
connector.connect()

All events

  • LCIConnector
    • connect When lcinterface connects to the league client
    • disconnect When lcinterface disconnects from the league client

Using LCIClient

LCIClient is an object with functions and data

Endpoints

All the built in endpoints in lcinterface

Usage

How to use the endpoints

await LCIclient.virtualCall(LCIClient.endpoints.user.me, "get")

All endpoints

The built-in endpoints, you cannot make add a new group (ex. user), only new endpoints

  • user
    • me [get/post] Gets local user data
  • game
    • gameflow [get] Current gameflow state
    • session [get] Current data of the match you are in
    • champselect [get] Champion select data
    • action (when you [get] session you will see what action means)
      • [patch] Needs action id (+/${actionId}) and data containing { championId }, doesn't return a body
      • [post] Needs action id (+/${actionId}) and data containing { championId }, doesn't return a body
  • runes
    • runes
      • [get] All runes of the user
      • [put] To change your runes
    • spells [patch] Set users active summoner spells, need data { spell1Id, spell2Id }, doesn't return a body
  • lobby
    • lobby
      • [get] Gets all data of the current lobby
      • [post] Change lobby data or create a lobby wich needs data { queueId }
    • search
      • [post] Starts searching a match (if in lobby), doesn't return a body
      • [delete] Stops searching a match (if in lobby), doesn't return a body
    • partytype [put] Set party to open or closed (string), doesn't return a body
    • position [put] Sets your lanes needs data { firstPreference, secondPreference }, doesn't return a body
    • matchaccept [post] Accepts a match
    • matchdecline [post] Declines a match

For all endpoints

https://lcu.vivide.re/

LCIClient data

All the built in data in lcinterface

Usage

console.log(LCIClient.game.lanes.UTILITY)

All data

  • gameflows
    • NONE
    • LOBBY
    • MATCHMAKING
    • READYCHECK
    • CHAMPSELECT
    • INPROGRESS
    • WAITINGFORSTATS
    • ENDOFGAME
  • lanes
    • UNSELECTED
    • TOP
    • JUNGLE
    • MIDDLE
    • BOTTOM
    • UTILITY
  • spells
    • Spellname (Barrier, Cleanse, Exhaust, Flash, Ghost, Heal, Smite, Teleport, Clarity, Ignite, Mark)
      • [id] Spell id
      • [key] Other spell name form (ex. summonerFlash)
      • [name] Spellname
  • queueId
    • normal
      • blind
      • draft
    • ranked
      • solo_duo
      • flex
    • extra
      • aram
  • partytype
    • open
    • closed

States

LCInterface has some built-in "states" that can giv you some information, how to get states / how to set/create states

  • [hooked] If LCInterfaces is hooked or not (boolean)
  • [vcc] Virtual call count, ammount of times a virtual call is made (number)
  • [unsafe] Can LCInterface make unsafe virtual calls (boolean), default is true
    • any you add

Interface functions

Hooking

"Hook" onto the interface aka initialise the interface, returns false if already hooked

  • params
    • [credentials] All the credentials
  • returns boolean
LCIClient.hook(credentials: object): boolean

Unhooking

"Unhook" for the league client, returns false if not yet hooked

  • return boolean
LCIClient.unhook(): boolean

Unsafe virual calls

You can make virutal calls if you aren't hooked yet, enabled by default

  • params
    • [value] Enable or disable the allowing of unsafe call (boolean)
  • returns boolean
LCIClient.allowUnsafeCalls(value: boolean): boolean

Interacting with the client

Interact with the league client's endpoints is async

  • params
    • [endpoint] Where to make the call to (string)
    • [method] What method to use
    • [data] (optional) What data to send (object | string), default is empty object
  • returns json obj <T> | a boolean
await LCIClient.virtualCall<T>(endpoint: string, method: methods, data: object | string = {}): Promise<T | boolean>

Getting a state

LCInterface has some built in states (wich you can add to), that you can check

  • params
    • [state] What state to check (string)
  • returns state data <T> | false if state doesn't exist
LCIClient.getState<T>(state: string): T | boolean

Setting / Creating a state

LCInterface has some built in states, wich you can set or add to

  • params
    • [state] What state to change / create (string)
    • [value] What to set it to
  • returns state data <T>
LCIClient.setState<T>(state: string, value: T): T

Checking a state's value

Here you can check the value of a state

  • params
    • [state] The state to check (string)
  • returns boolean
LCIClient.isCorrectValue<T>(state: string, value: T): boolean

Fast interface functions

LCInterface also has a few faster (unsafer) versions of methods

Fast hook

Same as the default hook but skips any checks, assumes you are unhooked (will overide data) and is still async

  • params
    • [credentials] Only port and password are required
  • returns always true
await LCIClient.__fasthook(credentials: base_credentials): boolean

Fast unhook

Same as the default unhook but skips any checks, assumes you are hooked and is still async

  • returns always false
await LCIClient.__fastunhook(): boolean

Fast virtual call

Same as the default virtual call but skips increasing vcc count, assumes you are hooked and is still async

  • returns json obj <T>
await LCIClient.__fastvirtualCall<T>(endpoint: string, method: methods, data: object | string = {}): Promise<T>

License

MIT License