hs-standard-sets
TypeScript icon, indicating that this package has built-in type declarations

2.4.1 • Public • Published

Hearthstone standard cards sets

npm version GitHub license CircleCI

hs-standard-sets is a utility that returns standard Hearthstone card sets available on a given date.

Usage

Returns the standard card sets that matches the conditions given by the options.

Options

Option Default
date new Date() Returns available card sets at the given date. If omitted, the current date will be used.
withoutClassic false If set to true, returns card sets excluding classic sets.
isExpired false If set to true, returns expired card sets.

The name of each card set conforms to "set" property provided by HearthstoneJSON.

in Node.js

import {sets} from 'hs-standard-sets';
// const sets = require('hs-standard-sets').sets;

sets(); // As of May 2, 2019
// => [ 'CORE', 'EXPERT1', 'GILNEAS', 'BOOMSDAY', 'TROLL', 'DALARAN' ]

sets({withoutClassic: true});
// => [ 'GILNEAS', 'BOOMSDAY', 'TROLL', 'DALARAN' ]

sets({isExpired: true});
// => [ 'NAXX', 'GVG', 'BRM', 'TGT', 'LOE', 'OG', 'KARA', 'GANGS', 'UNGORO', 'ICECROWN', 'LOOTAPALOOZA' ]

sets({date: new Date('2019-04-08')}); // Last day of the year of the Raven
// => [ 'CORE', 'EXPERT1', 'UNGORO', 'ICECROWN', 'LOOTAPALOOZA', 'GILNEAS', 'BOOMSDAY', 'TROLL' ]

in Browser

<script src="https://unpkg.com/hs-standard-sets/lib/index.js"></script>
<script>
HsStandardSets.sets(); // As of May 2, 2019
// => [ 'CORE', 'EXPERT1', 'GILNEAS', 'BOOMSDAY', 'TROLL', 'DALARAN' ]

HsStandardSets.sets({withoutClassic: true});
// => [ 'GILNEAS', 'BOOMSDAY', 'TROLL', 'DALARAN' ]

HsStandardSets.sets({isExpired: true});
// => [ 'NAXX', 'GVG', 'BRM', 'TGT', 'LOE', 'OG', 'KARA', 'GANGS', 'UNGORO', 'ICECROWN', 'LOOTAPALOOZA' ]

HsStandardSets.sets({date: new Date('2019-04-08')}); // Last day of the year of the Raven
// => [ 'CORE', 'EXPERT1', 'UNGORO', 'ICECROWN', 'LOOTAPALOOZA', 'GILNEAS', 'BOOMSDAY', 'TROLL' ]
</script>

Installation

npm install --save hs-standard-sets

Test

npm run test

License

MIT license

Readme

Keywords

Package Sidebar

Install

npm i hs-standard-sets

Weekly Downloads

2

Version

2.4.1

License

MIT

Unpacked Size

38.5 kB

Total Files

21

Last publish

Collaborators

  • sakai-akinobu