UNPKG

tarotap

Version:

Complete 78-card Tarot deck library with 17-language support (EN/DE/ES/FR/IT/JA/KO/NL/PT/RU/TW/ZH/TH/TR/PL/DA/NO) and TypeScript

141 lines (102 loc) 4.08 kB
# Tarotap - Tarot Card Library > Complete 78-card Tarot deck library ## Features - Complete 78 tarot cards (22 Major Arcana + 56 Minor Arcana) - Multi-language support (17 languages: English, German, Spanish, French, Italian, Japanese, Korean, Dutch, Portuguese, Russian, Traditional Chinese, Simplified Chinese, Thai, Turkish, Polish, Danish, Norwegian) - Random card drawing - Search cards by name or ID - Filter by Major/Minor Arcana and suits - Zero dependencies ## Installation ```bash npm install tarotap ``` ## Usage ```typescript import { getRandomCard, drawCards, getCardById, getMajorArcana, TarotCard } from 'tarotap'; // Get a random card (English by default) const card: TarotCard = getRandomCard(); console.log(card.name); // "The Fool" // Get a random card in German const cardDE: TarotCard = getRandomCard('de'); console.log(cardDE.name); // "Der Narr" // Get a random card in Spanish const cardES: TarotCard = getRandomCard('es'); console.log(cardES.name); // "El Loco" // Get a random card in French const cardFR: TarotCard = getRandomCard('fr'); console.log(cardFR.name); // "Le Mat" // Get a random card in Italian const cardIT: TarotCard = getRandomCard('it'); console.log(cardIT.name); // "Il Matto" // Get a random card in Japanese const cardJA: TarotCard = getRandomCard('ja'); console.log(cardJA.name); // "愚者" // Get a random card in Korean const cardKO: TarotCard = getRandomCard('ko'); console.log(cardKO.name); // "바보" // Get a random card in Dutch const cardNL: TarotCard = getRandomCard('nl'); console.log(cardNL.name); // "De Dwaas" // Get a random card in Portuguese const cardPT: TarotCard = getRandomCard('pt'); console.log(cardPT.name); // "O Louco" // Get a random card in Russian const cardRU: TarotCard = getRandomCard('ru'); console.log(cardRU.name); // "Шут" // Get a random card in Traditional Chinese const cardTW: TarotCard = getRandomCard('tw'); console.log(cardTW.name); // "愚者" // Get a random card in Simplified Chinese const cardZH: TarotCard = getRandomCard('zh'); console.log(cardZH.name); // "愚人" // Get a random card in Thai const cardTH: TarotCard = getRandomCard('th'); console.log(cardTH.name); // "คนโง่" // Get a random card in Turkish const cardTR: TarotCard = getRandomCard('tr'); console.log(cardTR.name); // "Aptal" // Get a random card in Polish const cardPL: TarotCard = getRandomCard('pl'); console.log(cardPL.name); // "Głupiec" // Get a random card in Danish const cardDA: TarotCard = getRandomCard('da'); console.log(cardDA.name); // "Narren" // Get a random card in Norwegian const cardNO: TarotCard = getRandomCard('no'); console.log(cardNO.name); // "Narren" // Draw multiple cards const cards: TarotCard[] = drawCards(3, false, 'ja'); // Get specific card const fool: TarotCard | null = getCardById('the-fool', 'en'); // Get Major Arcana in Korean const majorArcana: TarotCard[] = getMajorArcana('ko'); ``` CommonJS: ```javascript const tarotap = require('tarotap'); const card = tarotap.getRandomCard('de'); ``` ## API - `getAllCards(language?)` - Get all 78 cards - `getCardById(id, language?)` - Get card by ID - `getRandomCard(language?)` - Get random card - `drawCards(count, allowDuplicates?, language?)` - Draw multiple cards - `getMajorArcana(language?)` - Get Major Arcana cards - `getMinorArcana(language?)` - Get Minor Arcana cards - `getCardsBySuit(suit, language?)` - Get cards by suit - `searchCards(query, language?)` - Search cards **Languages (17)**: `'en'` (English), `'de'` (German), `'es'` (Spanish), `'fr'` (French), `'it'` (Italian), `'ja'` (Japanese), `'ko'` (Korean), `'nl'` (Dutch), `'pt'` (Portuguese), `'ru'` (Russian), `'tw'` (Traditional Chinese), `'zh'` (Simplified Chinese), `'th'` (Thai), `'tr'` (Turkish), `'pl'` (Polish), `'da'` (Danish), `'no'` (Norwegian) ## Card Format ```javascript { "id": "the-fool", "name": "The Fool" } ``` ## Live Demo Try it at [Tarotap.com](https://tarotap.com/en) ## License MIT --- *Made with ❤️ by the Tarotap Team - Bringing ancient wisdom to the digital age*