Socket
Socket
Sign inDemoInstall

hearthstone-cards

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hearthstone-cards

A module to fetch hearthstone card information using the HearthstoneJSON api.


Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

hearthstone-cards

A module to fetch hearthstone card information using the HearthstoneJSON API.

Usage

hearthstone(filters, collectible = true)

Returns a Promise of an array of objects.

filters - Filters that specify which cards to find. For example, hearthstone({ "cost": 10 }) will produce an array of all collectible cards that cost 10 mana. For more information, click here.

collectible - An optional argument that determines whether or not the card is a collectible. An example of a non-collectible card is Essence of the Red, a hero power used by Vaelastrasz the Corrupt in the Blackrock Mountain expansion.

Examples

This is an example of fetching all cards with the given filters:

  • Costs 6 mana crystals
  • Belongs to the Journey to Un'Goro expansion
  • Legendary rarity
const hearthstone = require("./hearthstone.js");

hearthstone({
    "cost": 6,
    "set": "UNGORO",
    "rarity": "LEGENDARY"
}).then(cards => {
    cards.forEach(card => {
        console.log(`${card.name} - ${card.text.replace(/\n/g, " ")} [ATK ${card.attack} HP ${card.health}]`);
    });
}).catch(console.error);

The above code will produce this:

Elise the Trailblazer - <b>Battlecry:</b> Shuffle a sealed�<b>Un'Goro</b> pack into�your deck. [ATK 5 HP 5]
Lyra the Sunshard - Whenever you cast a spell, add a random Priest spell to your hand. [ATK 3 HP 5]

Keywords

FAQs

Package last updated on 17 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc