# bodyText()
The printed text of the card. This is as the text is printed on the card so this will be in foreign language or differ from the Oracle type if it has received errata. This will also format split/aftermath cards to display both halves of the card together
# Card()
This is a wrapper around the JSON data returned from the Scryfall API with additional properties for geting various formatted information about the card.
# constructor(data)
Creates an instance of Card.
Parameters
Name | Types | Description |
---|---|---|
data | * |
Scryfall API card json |
# isSplitCard()
Gets whether the card is equivalent to a "split" card having two parts on the same card. For example, "Split", "Aftermath", "Adventure". This is not the same as a DFC.
# manaCost()
The mana cost of the card e.g. {2}{G} This will show the cost on the currently selected face if a DFC, and both if a split card e.g. "{1}{R} // {W}"
# manaCostAndType()
Formats the mana cost and typeline into a string depending on card type. Uses the printed text
# name()
The printed name of the card. This is as the name is printed on the card so this will be the name in a foreign language etc
# oracleManaCostAndType()
Formats the mana cost and typeline into a string depending on card type. Uses the Oracle text
# oracleText()
The printed text of the card as it appears in the Oracle This will also format split/aftermath cards to display both halves of the card together
# safeData()
Gets the current face of a card in the case of it being a DFC, Otherwise it will just give you the data.
# this.currentFace()
The current "face" of the card being viewed if it is a DFC (double-faced card). This will be 0 for all cards and the front card and 1 for the "back". Use @see flip to change.
# type()
The printed type of the card. This is as the type is printed on the card so this will be the name in a foreign language or different from the Oracle type if it has received errata
# module.exports.findPrints(Card)
Gets an array of reprints of a single card
Parameters
Name | Types | Description |
---|---|---|
Card | Card |
object |
# module.exports.getCard(cardId)
Gets a single card with a given ID
Parameters
Name | Types | Description |
---|---|---|
cardId | string |
# module.exports.searchCards(query)
Searches Scryfall for cards. Uses searching syntax from https://scryfall.com/docs/syntax
Parameters
Name | Types | Description |
---|---|---|
query | string |
Search query |