fh-cards
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

FH Cards

A standard 52-card deck library.

npm npm npm Travis

Install

npm install fh-cards

Features

Example

This example is in TypeScript. It creates a standard deck, shuffles it, draws 2 cards, and then shows those two cards as strings.

import { Card, Deck, StandardDeck } from "fh-cards";
 
let deck: Deck = new StandardDeck();
deck.shuffle();
 
let hand: Card[] = deck.draws(2);
hand[0].toString(); // "8d"
hand[1].toString(); // "Ac"

This example is in JavaScript. It does the same thing as the previous example.

let fhc = require("fh-cards");
let StandardDeck = fhc.StandardDeck;
 
let deck = new StandardDeck();
deck.shuffle();
 
let hand = deck.draws(2);
hand[0].toString(); // "Ts"
hand[1].toString(); // "5h"

Documentation

API

License

MIT

Package Sidebar

Install

npm i fh-cards

Weekly Downloads

1

Version

1.1.2

License

MIT

Last publish

Collaborators

  • kylejune