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

mtg-list

v1.1.0

Published

List current Magic the Gathering expansions and cards in them.

Downloads

4

Readme

mtg-list

A node extension for listing out existing Magic the Gathering™ (© WotC) expansions and cards.

This is backed by magiccards.info. If you're looking for specific card info / stats / ruling / type / text search, this won't do what you want - try tutor instead (that's backed by the official Gatherer. The only advantage this has over it is that this includes promo sets and alternate art (and potentially later, tokens).

Installing

npm install mtg-list

API

var mtg = require("mtg-list");

Each of these methods takes an optional language parameter, defaulting to "en". The full set of options are "en", "de", "fr", "it", "es", "pt", "jp", "cn", "ru", and "tw" (theoretically all of those work, but the tests for this only cover English).

expansions([language], callback)

Expects a callback in the form function(error, result). The result passed back is an object with set abbreviations (e.g. "ths" = Theros) as keys and the full set name as values.

   { jou: 'Journey into Nyx',
     bng: 'Born of the Gods',
     ths: 'Theros',
     dgm: 'Dragon\'s Maze',
     gtc: 'Gatecrash',
     rtr: 'Return to Ravnica',
     avr: 'Avacyn Restored',
     dka: 'Dark Ascension',
     isd: 'Innistrad',
     ...

cardsInExpansion(expansion, [language,] callback)

Expects a callback in the form function(error, results). The results passed back is an array containing all cards found in that set.

Each card contains the following properties:

  • number - The number of the card within the set.
  • name - The full name.
  • type - The card's type, as printed.
  • mana - The mana cost, or null if it doesn't have one.
  • rarity - The rarity, fully spelled out. The possible values are "Common", "Uncommon", "Rare", "Mythic Rare", "Land", and "Special".
  • artist - The artist's name.
   [ { number: '1',
       name: 'Cao Cao, Lord of Wei',
       type: 'Legendary Creature — Human Soldier 3/3',
       mana: '3BB',
       rarity: 'Mythic Rare',
       artist: 'Gao Jianzhang' },
     { number: '2',
       name: 'Captain Sisay',
       type: 'Legendary Creature — Human Soldier 2/2',
       mana: '2WG',
       rarity: 'Mythic Rare',
       artist: 'Ray Lago' },
     { number: '3',
       name: 'Doran, the Siege Tower',
       type: 'Legendary Creature — Treefolk Shaman 0/5',
       mana: 'WBG',
       rarity: 'Mythic Rare',
       artist: 'Mark Zug' },
     { number: '4',
       name: 'Kiki-Jiki, Mirror Breaker',
       type: 'Legendary Creature — Goblin Shaman 2/2',
       mana: '2RRR',
       rarity: 'Mythic Rare',
       artist: 'Steven Belledin' },
     ...

cardImageURL(expansion, number[, language])

Returns a URL that (hopefully*) points to a scan of that card, hosted by magiccards.info. As this is hosted by them, please cache it locally if you need it more than once to avoid putting undue strain on their servers.

(* Hopefully = They have some dead links)

License

MIT