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

zed.gg

v1.1.2

Published

RiotApi wrapper in TypeScript

Readme

zed.gg

Riot Api wrapper for Node.js written in typescript. RateLimit is handled with our built in logic and with the response headers (even async!). The first request is always sync, so we can adjust our RateLimit handler to the headers. retry-after case is not implemented yet. If you have any issues, just contact me on discord: nitash#3613!

NPM

Build Status

npm install zed.gg --save

Getting started

All methods do return a Promise<T> so you can await it with ES6;

Basic

import { Queue, Region, Season } from 'zed.gg/enums';
import { RateLimit, ZedGG } from 'zed.gg';

import { CustomResponseException } from 'zed.gg/models';
import { MatchlistByAccountIdOptions } from 'zed.gg/request-options';

let zedGG = new ZedGG(Region.EUROPE_WEST, 'YOUR_API_KEY'); // Uses default development rate limits
let zedGG = new ZedGG(Region.EUROPE_WEST, 'YOUR_API_KEY', new RateLimit(10, 100), new RateLimit(600, 6000)); // ZedGG with two rate limits. 100 calls in 10 secnds and 6000 calls in 600 seconds.

Exceptions

Exceptions are returned as CustomResponseException. You can check it with instanceof.

try {
  let summoner = await zedGG.summoners.by.name('nitash');
}
catch (ex) {
  if (ex instanceof CustomResponseException) { // We have a CustomResponseException
    let rex = ex as CustomResponseException;
    console.log(rex.requestUrl);
    console.log(rex.date);
    console.log(rex.statusCode);
    console.log(rex.headers);
    throw rex;
  }
  throw ex; // We have another exception
}

Summoners

zedGG.summoners.by.name('nitash').then(r => console.log(r));
zedGG.summoners.by.accountId(29987287).then(r => console.log(r));
zedGG.summoners.by.summonerId(25837773).then(r => console.log(r));

zedGG.summoners.by.* returns a Summoner

Matchlists

let matchlistByAccountIdOptions = new MatchlistByAccountIdOptions();
matchlistByAccountIdOptions.season = Season.PRESEASON2017;
matchlistByAccountIdOptions.queue = Queue.RANKED_SOLO_5x5;
matchlistByAccountIdOptions.beginIndex = 1;
matchlistByAccountIdOptions.endIndex = 20;
matchlistByAccountIdOptions.champion = 62;
matchlistByAccountIdOptions.beginTime = new Date(2017, 4, 10);
matchlistByAccountIdOptions.endTime = new Date(2017, 6, 10);

zedGG.matchlists.by.accountId(29987287).then(r => console.log(r));
zedGG.matchlists.by.accountId(29987287, matchlistByAccountIdOptions).then(r => console.log(r));
zedGG.matchlists.by.accountIdRecent(29987287).then(r => console.log(r));

zedGG.matchlists.by.* returns Matchlist

Matches

zedGG.matches.by.matchId(3199845416).then(r => console.log(r));

zedGG.matches.by.matchId returns a Match

Leagues

zedGG.leagues.by.summonerId(25837773).then(r => console.log(r));

zedGG.leagues.by.summonerId returns a LeagueList

Notes

This wrapper is far by perfect. We have a lot of work to do. In the coming week I will try to add as many endpoint requests as possible and better documentation.

Models

There is a lot of models which are exported. Just download the package and explore them in TypeScript! :)

Summoner

export declare class Summoner {
    id: number;
    accountId: number;
    name: string;
    summonerLevel: number;
    profileIconId: number;
    revisionDate: Date;
}

Matchlist

export declare class Matchlist {
    totalGames: number;
    beginIndex: number;
    endIndex: number;
    matches: MatchReference[];
}

Match

export declare class Match {
    gameId: number;
    season: Season;
    queue: Queue;
    region: Region;
    gameVersion: string;
    gameMode: string;
    gameType: string;
    map: LeagueMap;
    gameDuration: number;
    playedOn: Date;
    matchTeams: MatchTeam[];
}

LeagueList

export declare class LeagueList {
    name: string;
    tier: Tier;
    queue: Queue;
    entries: LeagueEntry[];
}