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

legends-cli

v1.0.9

Published

League of Legends CLI Stats Tool

Readme

⚔ Legends CLI Stats

Ferramenta de linha de comando para consultar estatísticas do League of Legends via Riot Games API.


Funcionalidades

| Feature | Descrição | |---|---| | 🔍 Busca por Riot ID | PlayerName#TAG ou só o nome (assume #BR1) | | 📋 Partidas recentes | 20, 30, 50 ou 100 últimas partidas com KDA, duração, resultado | | ⭐ Top 5 Maestrias | Campeões com maior maestria, nível e pontos | | 🏆 Leaderboard | Challenger / Grandmaster / Master por região | | 🌍 Multi-região | BR1, NA1, EUW1, KR, JP1, etc. | | 🎯 Filtro de fila | Todas / Ranked / Normal / ARAM | | 📑 Paginação | Navega pelas partidas página a página | | 💾 Cache | Respostas cacheadas por 5 min (partidas: 1h) | | 🎨 UI colorida | Tabelas formatadas com chalk + cli-table3 | | ⚠️ Tratamento de erros | Rate limit, 404, 401, etc. com mensagens claras |


Instalação

Via npm (recomendado)

npm install -g legends-cli

Manual (desenvolvimento)

# Clone / extraia o projeto
cd legends-cli

# Instale dependências
npm install

Configuração da API Key

1. Obtenha sua chave

  1. Acesse developer.riotgames.com
  2. Faça login com sua conta Riot
  3. Copie a Development API Key no painel (válida por 24h)

💡 Se você rodar legends-cli sem ter configurado a chave, o terminal vai exibir as instruções e abrir o site da Riot automaticamente no navegador.

2. Configure com um comando

legends-cli RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

A chave é salva em ~/.legends-cli/.env e vale para qualquer diretório. Nenhum arquivo .env manual necessário.


Uso

legends-cli
# ou, em desenvolvimento local:
npm start

Fluxo de uso

Selecione região → Menu Principal
  ├── 🔍 Buscar jogador
  │     ├── Digite: PlayerName#BR1
  │     ├── Ver Partidas Recentes
  │     │     ├── Escolha quantidade (20/30/50/100)
  │     │     ├── Escolha filtro (Todas/Ranked/Normal/ARAM)
  │     │     └── Paginação navegável
  │     └── Ver Top 5 Maestrias
  ├── 🏆 Top Players
  │     ├── Tier: Challenger / Grandmaster / Master
  │     └── Top 10 / 20 / 50 / 100
  ├── 🌍 Trocar região
  ├── 🗑  Limpar cache
  └── ❌ Sair

Estrutura do Projeto

legends-cli/
├── src/
│   ├── index.ts           # Entry point + menu principal + setup da API key
│   ├── types.ts           # Tipos, regiões, filas
│   ├── riot-client.ts     # Cliente da API com cache + erros
│   ├── champions.ts       # Dados de campeões (Data Dragon)
│   ├── cache.ts           # Cache em arquivo (~/.tmp/legends-cli-cache)
│   ├── display.ts         # Tabelas e formatação colorida
│   └── menus/
│       ├── player-lookup.ts  # Menu de busca por jogador
│       └── top-players.ts    # Menu de leaderboard
├── .env.example
├── package.json
└── tsconfig.json

Notas técnicas

  • API Key: salva em ~/.legends-cli/.env, configurada com legends-cli <KEY>
  • Cache: arquivos JSON em $TMPDIR/legends-cli-cache/ com TTL configurável
  • Rate Limit: se atingido (HTTP 429), exibe mensagem clara e para
  • DDragon: nomes dos campeões carregados uma vez com cache de 24h
  • Routing: regiões de plataforma (br1, na1…) e cluster regional (americas, europe…) são tratados separadamente conforme a Riot API exige