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

@lol-inspector/league-commons

v1.3.0

Published

Shared logic for League of Legends apps (Champion lists, fuzzy search, summoner spells)

Readme

@gkucmierz/league-commons

A shared utility library for applications within the League of Legends ecosystem. It currently focuses on static champion data, summoner spells, and advanced fuzzy search capabilities.

Installation

This package is published globally on the public npmjs.com registry. To install:

npm install @gkucmierz/league-commons

Available Features & API

1. champNames (Array)

A complete, alphabetical list of all available champions in the game (Strings). It serves as a Single Source of Truth across all applications in the ecosystem.

import { champNames } from '@gkucmierz/league-commons';

console.log(champNames.includes('Aatrox')); // true
console.log(champNames.length); // Total number of champions

2. fuzzySearchChampions(query) (Function)

An intelligent fuzzy search function based on Levenshtein distance. It returns a sorted list of champions that best match the given query, making it highly resilient to typos and partial inputs.

Parameters:

  • query (String): The search query. If empty, it returns the full alphabetical list.

Returns:

  • Array<String>: A sorted list of matching champion names.

Example:

import { fuzzySearchChampions } from '@gkucmierz/league-commons';

// Searching with typos or abbreviations
const results = fuzzySearchChampions('wukn'); 
console.log(results); // ['Wukong', ...]

// Empty query returns all champions
const all = fuzzySearchChampions(''); 

3. normalizeChampionName(name) (Function)

Resolves any string representation of a champion name into its canonical Data Dragon ID. Highly useful for standardizing inputs with spaces, dots, or casing inconsistencies.

Example:

import { normalizeChampionName } from '@gkucmierz/league-commons';

console.log(normalizeChampionName('Nunu & Willump')); // 'Nunu'
console.log(normalizeChampionName('wukong')); // 'MonkeyKing'
console.log(normalizeChampionName('Renata Glasc')); // 'Renata'

4. compareChampions(nameA, nameB) (Function)

Safely compares two champion strings by ignoring casing, spaces, punctuation, and exception mappings.

Example:

import { compareChampions } from '@gkucmierz/league-commons';

console.log(compareChampions('Wukong', 'MonkeyKing')); // true
console.log(compareChampions('nunu&willump', 'Nunu')); // true

5. OFFLINE_CHAMPION_DICTIONARY & CHAMPION_ID_EXCEPTIONS (Objects)

Direct access to the underlying mapping dictionaries for offline fallback support or custom logic routing.

6. summonerSpells (Array)

A ready-to-use dictionary (array format) of summoner spells mapped to their official Riot API identifiers (Riot ID).

Example:

import { summonerSpells } from '@gkucmierz/league-commons';

// Example: Automatic mapping for the LCU Agent policy
console.log(summonerSpells.find(s => s.name === 'Flash').id); // 4

7. calculateKdaRatio(scores) (Function)

Calculates a formatted KDA (Kills/Deaths/Assists) ratio from a standard score object. Automatically handles edge cases like zero deaths (perfect KDA).

Example:

import { calculateKdaRatio } from '@gkucmierz/league-commons';

const scores = { kills: 9, deaths: 2, assists: 3 };
console.log(calculateKdaRatio(scores)); // "6.00"

const perfect = { kills: 5, deaths: 0, assists: 2 };
console.log(calculateKdaRatio(perfect)); // "7.00"

Build & Publishing (CI/CD)

This package utilizes an automated CI/CD pipeline via Gitea Actions. Every push to the main branch automatically publishes a new release to the npm registry using a global secret tied to the gkucmierz user.