npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fab-cards

v8.0.147

Published

TypeScript representations of Flesh and Blood cards

Downloads

29

Readme

Flesh and Blood cards

8.0 breaking changes

  • card.images has been deprecated in favor of card.printings
  • defaultImageName has been renamed defaultImage for brevity
  • specialImageName has been renamed specialImage for brevity

7.0 breaking changes

  • card.rarity has been deprecated in favor of card.rarities

Overview and installation

A library of all Flesh and Blood cards, available as a bundled TypeScript file with matching interfaces. Source data comes from the amazing the-fab-cube/flesh-and-blood-cards repository maintained by Tyler Luce - all credit goes to him, and all errors are probably added by me in this project 😅.

To install run npm i --save fab-cards.

Access the card data in your project:

import { cards } from "fab-cards";

cards.forEach((card) => {
  // do stuff with the card data
});

Card interfaces

Card contains all of the fields that could show up for any particular card. Required fields can be found on every card, while optional fields may or may not exist on any given card.

Required

| Field | Data type | Examples | | -------------- | -------------------- | ------------------------------------------ | | artists | string array | [ "Riordan Delmiro" ] | | cardIdentifier | string | "snatch-red", "aether-wildfire-red" | | classes | Class enum array | ["Generic"], ["Warrior","Wizard"] | | defaultImage | string | "1HP001.width-450" | | printings | Printing array | see Printing | | name | string | "Rain Razors", "Pummel" | | rarities | Rarity enum array | ["Super Rare"], ["Token", "Majestic"] | | setIdentifiers | string array | [ "1HP009", "CRU006" ] | | sets | Release enum array | [ "History Pack 1", "Crucible of War" ] | | specialImage | string | "1HP001.width-450" | | subtypes | Subtype enum array | ["OneHanded", "Dagger"], ["Aura"] | | types | Type enum array | ["Action"], ["Hero"] | | typeText | string | "Elemental Ranger Action – Arrow Attack" |

Optional

| Field | Data type | Examples | | -------------------------- | -------------------- | ------------------------------------ | | cost | number | 0, 10 | | defense | number | 3, 4 | | functionalText | string | "If Snatch hits, draw a card." | | fusions | Fusion enum array | [ "Earth", "Ice" ] | | hero | Hero enum | "Rhinar", "Dori" | | intellect | number | 3, 4 | | isCardBack | boolean | true | | keywords | Keyword enum array | [ "Boost" ] | | life | number | 18, 40 | | oppositeSideCardIdentifier | string | "invoke-kyloria-red", "tomeltai" | | pitch | number | 1, 2, 3 | | power | number | 3, 14 | | restrictedFormats | Format enum array | [ "Blitz" ] | | specialCost | string | "XX", "3X" | | specialDefense | string | "*" | | specialPower | string | "*" | | specializations | Hero enum array | ["Dromai","Fai"] | | talents | Talent enum array | [ "Draconic" ] | | young | boolean | true |

Printing contains information about the different printings a card has had (e.g. different sets, foilings)

| Field | Data type | Examples | | ---------- | --------------------------------- | ----------------------------------- | | edition | string of ReleaseEdition enum | "Alpha", "Unlimited" | | foiling | string of Foiling enum | "Cold", "Rainbow" | | identifier | string | "1HP001" | | image | string | "1HP001.width-450" | | set | string of Release enum | "Dynasty", "Uprising" | | treatment | string of Treatment enum | "Alternate Art", "Extended Art" |

Enums

Class

"NotClassed", "Generic", "Adjudicator", "Bard", "Brute", "Guardian", "Illusionist", "Mechanologist", "Merchant", "Ninja", "Ranger", "Runeblade", "Shapeshifter", "Warrior", "Wizard",

Format

"Blitz", "Clash", "Classic Constructed", "Commoner",

Fusion

"Earth", "Ice", "Lightning",

Rarity

"Token", "Common", "Rare", "Super Rare", "Majestic", "Legendary", "Fabled", "Promo",

Release

// Full sets
"Arcane Rising", "Crucible of War", "Dynasty", "Everfest", "History Pack 1", "Monarch", "Tales of Aria", "Uprising", "Welcome to Rathe",

// Hero/blitz decks
"Boltyn Blitz Deck", "Briar Blitz Deck", "Bravo Blitz Deck", "Chane Blitz Deck", "Classic Battles: Rhinar vs Dorinthea", "Dorinthea Hero Deck", "Ira Welcome Deck", "Katsu Hero Deck", "LeviaBlitzDeck", "Lexi Blitz Deck", "Oldhim Blitz Deck", "Prism Blitz Deck", "Rhinar Hero Deck",

// One-offs
"Promos",

Talent

"Draconic", "Earth", "Elemental", "Ice", "Light", "Lightning", "Royal", "Shadow",

Type

"Action", "Attack Action", "Attack Reaction", "Defense Reaction", "Equipment", "Hero", "Instant", "Mentor", "Resource", "Token", "Weapon",

Hero

"Arakni", "Azalea", "Benji", "Boltyn", "Bravo", "Briar", "Chane", "Dash", "Data Doll", "Dorinthea", "Emperor", "Genis Wotchuneed", "Ira", "Iyslander", "Kano", "Kassai", "Katsu", "Kavdaen", "Kayo", "Levia", "Lexi", "Oldhim", "Prism", "Rhinar", "Ruu’di", "Shiyana", "Taylor", "Valda", "Viserai", "Yorick",

Keyword

"Arcane Barrier", "Battleworn", "Blade Break", "Blood Debt", "Boost", "Channel", "Charge", "Combo", "Crush", "Dominate", "Essence", "Freeze", "Fusion", "Go Again", "Heave", "Intimidate", "Legendary", "Mentor", "Negate", "Opt", "Phantasm", "Reload", "Reprise", "Specialization", "Spectra", "Spellvoid", "Temper", "Thaw", "Unfreeze",

Working with this project

Card data

Data transformations

There are three steps involved in transforming the .tsv source data into typed .ts code - executed via npm run transform.

  1. src/parser.ts reads from the .tsv file and converts the data into JavaScript objects (performing basic steps like converting comma-delimited lists into arrays)
  2. src/mapper.ts takes the parsed card data and transforms it to match the interfaces in src/interfaces.ts
  3. src/writer.ts creates .ts files containing the card information and all types

Bundling the library

To generate the distributed package code run npm run build after transforming the data.