New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

fh-cards

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fh-cards

A standard 52-card deck library

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

FH Cards

A standard 52-card deck library.

npm npm npm Travis

Install

npm install fh-cards

Features

  • Uses the Fisher-Yates shuffle algorithm
  • Optional Joker cards

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

Keywords

cards

FAQs

Package last updated on 03 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