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

champion

v2.0.1

Published

Get a League of Legends champion from their key.

Readme

champion

Get a League of Legends champion from their key.

Build Status Testling Badge

Example

var champion = require('champion');

champion(117);
// => {
// =>   "version": "3.10.3",
// =>   "id": "Lulu",
// =>   "key": "117",
// =>   "name": "Lulu",
// =>   "title": "the Fae Sorceress",
// =>   /* etc, etc. */
// => }

You would probably use this with node-resteemo:

var resteemo = require('resteemo')('string with contact info');

resteemo.player.ingame('na', 'king trick', function(error, response) {
  if (error) throw error;

  var championID = response.data.game.playerChampionSelections.array[0].championId;

  champion(championID);
  // Now you know the champion that 'king trick' is playing.
});

Installation

$ npm install champion

Browserify for the browser or use Component:

$ component install KenanY/champion

API

champion(key)

Look up a champion using a Number key and return an Object containing metadata on the champion. If key does not match that of any champion, null is returned.

The array

Yeah, it's huge, but the current method is better than using fs or http.

If a new champion hasn't been added to the array yet, feel free to open a pull request. In the future, I might move the array to its own module so that others can use it in their modules.

Lessons learned

Originally, this module used fs.createReadStream in order to load a JSON file of champions. This ReadStream was then piped to JSONStream, but this caused problems because of a known issue involving precise numbers (which are used for a champion's health regeneration and such).

Using fs also prevented this module from working in the browser. So, I did a quick refactor and replaced the JSON file with a JavaScript one. This JavaScript file exports the array of champions and as such can be require()d and browserified.