🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more →
Socket
Book a DemoInstallSign in
Socket

card-deck-strings

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

card-deck-strings

Provides unicode strings for playing cards

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Playing cards' strings

It's convenient to use Unicode strings while prototyping a card game.

Wikipedia Demo

This library is a small wrapper for those strings to make it even more convenient.

Setup

card-deck-strings can be installed with npm or using a content delivery network URL to embed it on your HTML page

npm i card-deck-strings

or

<script src="https://unpkg.com/card-deck-strings"></script>

Usage

Card strings can be obtained by a name or id. The both are case insensitive. The trump strings are obtained by index. See the full list in Wiki.

import { getCard, getCardBack, getJoker, getTrump } from 'card-deck-strings';
const aceOfSpades = getCard('Ace of Spades');
const as = getCard('as');
const back = getCardBack();
const redJoker = getJoker('Red Joker');
const whiteJoker = getJoker('wj');
const fool = getTrump(0);

Given loaded in the global context, the methods above live under CardDeck namespce.

const queenOfDiamonds = CardDeck.getCard('QD');

License

Copyright © 2019, Sergey Chernykh. Released under the MIT License.

Keywords

playing card

FAQs

Package last updated on 16 Jul 2020

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