yarn add 52-deck
- or
npm install 52-deck
import { newDeck } from '52-deck'
const deck = newDeck()
import { shuffle, newDecks } from '52-deck'
const deck = shuffle(newDecks(2))
import { serializeCards } from '52-deck'
const [ firstCard, secondCard ] = serializeCards('♦K ♦2')
Valid input strings are:
h1 s1 d12
11d 9s 9d 4s 12h 13d 13h 11h
♠10 ♦1 ♥5 ♣6 ♠11 ♦10
1-h 10-s
12spades 8diamond
type Card = {
text: string,
suite: string,
value: number,
color: string
}