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

rivalsjs

v1.2.0

Published

<h1 align="center"> Rivals JS </h1>

Downloads

18

Readme

🚀 Core Ideas

  • Fully Typed – code with confidence
  • Functional – because classes are so... Java
  • Complete Coverage – for the entire Marvel Rivals API
  • Lean & Light – no unnecessary bloat

Q&A

How close is this to the API?

The goal for v1 of the library is to align as closely as possible with the API, with only a few differences:

  • Everything is camel cased
  • The update player endpoint has custom transformation logic as there's 2 different types of responses
  • All asset urls are fully qualified

Why functional?

Functional design allows RivalsJS to remain treeshakeable, letting bundlers strip unused code for minimal footprint.

Also because:

  • No need to manage class hierarchies
  • Just one Axios client to pass around
  • Simple testing: input in, output out

Will you ever add a class-based framework?

Maybe, but the core will always remain functional. If we did do a class-based framework it would be part of a bigger piece of the puzzle which we would try to solve on the foundational level first.

A full fledged framework is a huge task and frankly may be outside of the scope of this library.

You already have a v2 wishlist?

Yes! It was the first issue I created. While v1 focuses on building a solid foundation of the library, v2 I want to fix parts of the API that bug me. If there's something you'd like, then throw it on the list!

Getting Started

✅ Before you start

You must have an API key which you can retrieve here. If you have any issues with the API you can join the Discord server.

📦 Installation

npm install rivalsjs  # or
yarn add rivalsjs     # or
bun add rivalsjs

⚡ Jumping In

Creating the client

RivalsJS is designed to be thin, flexible, and functional. We've created a helper function that handles the ground work you need and you pass that Axios client to each function. No blackbox magic here.

import { createRivalsClient } from 'rivalsjs'

// This is just a standard AxiosInstance: https://axios-http.com/docs/instance
const client = createRivalsClient({
  apiKey: 'your-api-key'
})

Example

We support both CJS and ESM, but all examples use ESM. We use neverthrow under the hood, so you can rely on clean control flow using isOk() and isErr(). All functions return Result objects from neverthrow so you always know whether you're working with success or error values. No more try/catch clutter.

import { getHealthCheck } from 'rivalsjs/v1'

const healthcheck = await getHealthCheck(client)

if (healthcheck.isErr()) {
  console.error('An error occurred: ', healthcheck.error)
}

if (healthcheck.isOk()) {
  console.log(healthcheck.value)
  /*
    Output:
    {
      "error": false,
      "message": "Server is healthy",
      "serverTime": "timestamp",
      "serverResponseTime": "0ms",
      "status": 200
    }
  */
}

The same applies to all functions. All functions are documented with JSDoc, so you'll see everything inline in your editor.