mtg-deck-checker

1.2.1 • Public • Published

Usage:

npm i --save mtg-deck-checker

const Deck = require('mtg-deck-checker');

var decklist assumes cockatrice deck editor format.

var newDeck = new Deck.Deck(decklist, format);

Deck constructor will automatically run newDeck.check()

console.log(newDeck.isLegal, newDeck.errors);

You can see you deck hash with newDeck.hash

If you want to keep the same obj but update the deck or format

newDeck.check(decklist, format);

You can add cards to your deck, then check if it is still legal

newDeck.addCard("Ancestral Recall", 1);

newDeck.check();

console.log(newDeck.errors) // => ["Ancestral Recall not legal in modern!"]

Access mainboard/sideboard directly with newDeck.main, newDeck.side

Update new cardData.json with Deck.updateCardData()

TODO:

  • add checks for commander to make sure all cards are within commanders color identity

Package Sidebar

Install

npm i mtg-deck-checker

Weekly Downloads

23

Version

1.2.1

License

MIT

Unpacked Size

6.45 MB

Total Files

6

Last publish

Collaborators

  • benjaminpwagner