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

opgg-scraper

v3.0.2

Published

A promised based u.gg scraper for League of Legends with a few more data than other packages.

Downloads

62

Readme

API Reference

getStats(user, region, refresh)

Usage

import getStats from 'opgg-scraper';

async function test() {
  try {
    // Get stats and return only the results object
    const results = await getStats('trick2g#na1', 'na', true);
    return results;
  } catch (error) {
    return { error: error.message };
  }
}

// Run and display only the results object
test().then(results => console.log(results));       

##output

{
  name: 'Trick2g',
  level: '615',
  rank: 'Emerald 2',
  wins: '1',
  loses: '5',
  winrate: '17%',
  lp: '45 LP',
  mainChampion: 'Udyr',
  kda: '1.2 KDA',
  lastTime: '20 days ago',
  image: 'https://static.bigbrain.gg/assets/lol/riot_static/15.4.1/img/profileicon/6075.png'
}

Fetches player statistics from U.GG.

| Parameter | Type | Description | Default | |-----------|------|-------------|---------| | user | string | Summoner name with optional tag (e.g., 'PlayerName' or 'PlayerName#123') | - | | region | string | Server region (e.g., 'na', 'euw', 'kr') | - | | refresh | boolean | Whether to refresh the stats before scraping | false |

Returns a Promise that resolves to an object containing player statistics.

Supported Regions

  • na1 - North America
  • euw1 - Europe West
  • eune1 - Europe Nordic & East
  • kr - Korea
  • br1 - Brazil
  • jp1 - Japan
  • las1 - Latin America South
  • lan1 - Latin America North
  • oce1 - Oceania
  • tr1 - Turkey
  • ru1 - Russia

Troubleshooting

Browser Detection Issues

If the scraper fails to find a browser automatically, you can modify the getBrowserExecutablePath() function in index.js to point to your Chrome/Chromium executable location.

Selector Changes

U.GG may change their website structure periodically. If the scraper stops working, it might be due to CSS selector changes. Check the console errors and update the selectors in the scrapeUGG() function.

Changelog

2.0.0 (2023-07-14)

Breaking Changes

  • Switched from OP.GG to U.GG for data source
  • Changed output format structure

New Features

  • Added support for player tags (e.g., PlayerName#123)
  • Added profile image URL to output

Dependencies

License

This project is licensed under the MIT License - see the LICENSE file for details.

Buy Me a Coffee