-
-
Couldn't load subscription status.
- Fork 0
3. Tarot.js Decks
Jared Van Valkengoed edited this page Oct 6, 2025
·
1 revision
Tarot.js comes with decks organized by language and allows developers to add their own custom decks. This documentation explains the folder structure, naming conventions, and usage.
You can find the list of all the current decks here.
Decks should organized by language code. For example:
decks/
├─ en/
│ ├─ default.json
│ ├─ english_waites.json
├─ fr/
│ ├─ french.json
│ ├─ tarot_de_france.json
├─ es/
│ ├─ spanish.json
│ └─ tarot_espanol.json
- Each language has its own folder (e.g.,
enfor English,frfor French). - Deck files are
.jsonand contain arrays of Tarot card objects. - Developers can add new decks to the appropriate language folder.
- Use a descriptive name for the deck (e.g.,
waites.json). - Keep lowercase letters and underscores for multi-word names.
- Avoid special characters in filenames.
Each deck JSON file is an array of card objects. Example:
[
{
"name": "The Fool",
"arcana": "Major",
"number": 0,
"suit": null,
"meaning": {
"upright": "New beginnings, optimism, trust",
"reversed": "Recklessness, taken advantage of, inconsideration"
}
},
{
"name": "The Magician",
"arcana": "Major",
"number": 1,
"suit": null,
"meaning": {
"upright": "Skill, resourcefulness, manifestation",
"reversed": "Manipulation, poor planning, untapped talents"
}
}
]To add your own deck:
- Create a JSON file following the same structure as existing decks.
- Place it in the appropriate language folder, e.g.,
decks/en/my_custom_deck.json. - Load it in your code using
Tarot.initializeDeck():
import Tarot from '../tarot.js';
import customDeck from './decks/en/my_custom_deck.json' assert { type: "json" };
const tarot = new Tarot();
tarot.initializeDeck(customDeck);- Decks are immutable once initialized in the Tarot.js library.
- Developers can add multiple decks per language.
- Deck JSON files should be UTF-8 encoded to support special characters.