Skip to content

1. Getting Started

Jared Van Valkengoed edited this page Oct 6, 2025 · 1 revision

Here’s a quick guide to get started with Tarot.js:

1. Initialize a Tarot Deck

Initialize your deck with an array of card objects:

import Tarot from "https://esm.sh/gh/MarketingPipeline/Tarot.js";
const tarot = new Tarot();

const deck = tarot.initializeDeck([
  { name: 'The Fool', meaning: 'New beginnings, innocence' },
  { name: 'The Magician', meaning: 'Skill, power, manifestation' },
  { name: 'The High Priestess', meaning: 'Intuition, mystery, the subconscious' },
  // Add more card objects as needed
]);

2. Create Custom Spreads

Define custom spreads by specifying card positions and an optional description:

tarot.addSpread('Three-Card Spread', {
  positions: ['Past', 'Present', 'Future'],
  description: 'Provides insights into past, present, and future aspects.',
});

Note: "Cards" in your deck must be same length or greater then your positions in your spread.

3. Perform a Reading

Shuffle the deck and perform a reading using one of your custom spreads:

tarot.shuffleDeck();
const reading = tarot.doReading('Three-Card Spread');
console.log(reading);

4. Access Deck Information

Retrieve details about the current deck setup:

const deckInfo = tarot.getDeckInfo();
console.log(deckInfo);

5. List Custom Spreads

List all custom spreads you’ve created:

const spreads = tarot.listSpreads();
console.log(spreads); // Outputs: ['Three-Card Spread']
Clone this wiki locally