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

edhrec-recs

v0.1.0

Published

A wrapper for making requests to EDHREC's recommendation API

Downloads

4

Readme

edhrec-recs

A TypeScript wrapper for the EDHREC recommendations API.

Installation

npm install edhrec-recs

Or with yarn:

yarn add edhrec-recs

Usage

import { getRecommendations } from 'edhrec-recs';

// Get recommendations for a commander deck
async function example() {
  const recommendations = await getRecommendations({
    cards: ['Sol Ring', 'Arcane Signet'],
    commanders: ['Tinybones, Trinket Thief'],
    excludeLands: true,
  });
  
  // Print the top 5 recommendations
  recommendations.inRecs.slice(0, 5).forEach((card, index) => {
    console.log(`${index + 1}. ${card.name} (Score: ${card.score}/100)`);
  });
}

example();

API

getRecommendations(options)

Returns a Promise that resolves to card recommendations from EDHREC.

Options

  • cards - An array of card names to include in the deck
  • commanders - An array of commander card names for the deck
  • excludeLands - (Optional) Whether to exclude land cards from recommendations (default: false)
  • offset - (Optional) Offset for pagination (default: 0)
  • name - (Optional) Custom name for the deck

Response Structure

The response contains:

  • commanders - Array of commander information
  • deck - Object mapping included card names to quantity
  • inRecs - Array of recommended cards with scores
  • more - Boolean indicating if more recommendations are available
  • outRecs - Cards that were passed in but not included in recommendations

Example:

{
  commanders: [
    {
      name: 'Tinybones, Trinket Thief',
      oracle_id: '008eda1f-b913-4f04-8c29-5e87c270149e',
      primary_type: 'Creature',
      salt: 0.85,
      names: ['Tinybones, Trinket Thief']
    }
  ],
  deck: { 'Sol Ring': 1, 'Arcane Signet': 1 },
  inRecs: [
    {
      name: 'Dark Ritual',
      oracle_id: '53f7c868-b03e-4fc2-8dcf-a75bbfa3272b',
      primary_type: 'Instant',
      salt: 0.60,
      names: ['Dark Ritual'],
      score: 100
    },
    // ... more recommendations
  ],
  more: true,
  outRecs: []
}

License

MIT