-
-
Couldn't load subscription status.
- Fork 0
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:
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
]);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.
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);Retrieve details about the current deck setup:
const deckInfo = tarot.getDeckInfo();
console.log(deckInfo);List all custom spreads you’ve created:
const spreads = tarot.listSpreads();
console.log(spreads); // Outputs: ['Three-Card Spread']