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 🙏

© 2024 – Pkg Stats / Ryan Hefner

clashpi

v1.0.3

Published

A simple wrapper for the Clash Royale API

Downloads

7

Readme

Description

This package contains a simple, asynchronous, free, dependency-free node.js library for using the Clash Royale API.

Installation

  • Install node.js using from here.
  • Install clashpi with npm install clashpi
  • You will need a Clash Royale API key to use this library. To obtain a key, create an account here or if you already have one log in here. Afterwards click on My Account from where you can access your API keys. Copy the entire key.

Usage

Example:

First import the library and create a Client object.

const { Client } = require('clashpi');
const client = new Client(APIKEY);

Then call functions on the Client object.

client.getPlayer('#JGJYQ2P2V')
    .then(player => client.getUpcomingChests(player)
        .then(chests => console.log(chests)));

// OR

client.getUpcomingChests('#JGJYQ2P2V')
        .then(chests => console.log(chest));

client.getPlayerRanks('2023-03')
    .then(rankings => console.log(rankings));

Documentation

  • getCards(rarity = [Rarity.COMMON, Rarity.RARE, Rarity.EPIC, Rarity.LEGENDARY, Rarity.CHAMPION], name = [])

Get a list of all cards in the game, or filter by rarity or name

  • getChallenges()

Get a list of all challenges

  • getPlayer(tag)

Get all information about a specific player

  • getUpcomingChests(tag, index = undefined)

Get all (or a specific) upcoming chests of a specific player

  • getBattleLog(tag)

Get the battle log of a specific player

  • getLocations(limit = undefined)

Get a list of all locations in the game

  • getClanRanks(locationId, clanWars = false, limit = undefined)

Get a ranking of all clans in a certain location, either by clan ranking or by clan-war ranking

  • getPlayerRanks(seasonId, pathOfLegends = false, limit = undefined)

Get ranking of all players that played in a specific season, either by trophies or by path of legend rank

  • getTournaments(name, limit = undefined)

Get a list of all tournaments containing a specific name

  • getTournament(tag)

Get all information of about a specific tournament

  • getGlobalTournament()

Get a list of all global tournaments