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

tarot-deck

v2.0.1

Published

Tarot for Node!

Downloads

18

Readme

tarot-deck npm version

Tarot for Node! A thin javascript wrapper for the Tarot Interpretations from github.com/dariusk/corpora

Circle CI Code Climate Test Coverage

installation

npm install tarot-deck

#usage

var tarot = require('tarot-deck');

console.log( tarot.suits );
// [ 'major', 'wands', 'cups', 'swords', 'coins' ]

console.log( tarot.minorArcana );
// 56

console.log( tarot.getByRank(1) );
/* 
{ keywords: [ 'capability', 'empowerment', 'activity' ],
  meanings: 
   { light: 
      [ 'Taking appropriate action',
        'Receiving guidance from a higher power',
        'Becoming a channel of divine will',
        'Expressing masculine energy in appropriate and constructive ways',
        'Being yourself in every way' ],
     shadow: 
      [ 'Inflating your own ego',
        'Abusing talents',
        'Manipulating or deceiving others',
        'Being too aggressive',
        'Using cheap illusions to dazzle others',
        'Refusing to invest the time and effort needed to master your craft',
        'Taking shortcuts' ] },
  name: 'The Magician',
  rank: 1,
  suit: 'major' }
*/

console.log( tarot.drawCard() );
/*
{ keywords: [ 'health', 'wealth', 'practicality', 'receiving' ],
  meanings: 
   { light: 
      [ 'Outlining a plan for achieving prosperity',
        'Becoming aware of opportunities to improve income or health',
        'Realizing you have everything you need',
        'Appreciating everything the Universe has given you',
        'Receiving the perfect gift at the perfect time' ],
     shadow: 
      [ 'Indulging in relentless consumerism',
        'Wanting more, no matter how much you have',
        'Obsessing on your account balance',
        'Suffering from hypochondria',
        'Consuming blessings without expressing gratitude',
        'Taking what you want without concern for the needs of others' ] },
  name: 'ace of coins',
  rank: 1,
  suit: 'coins',
  reversed: true }
*/

console.log( tarot.drawReading() );
/*
[ { keywords: [ 'training', 'discipline', 'confidence', 'enough' ],
    meanings: { light: [Object], shadow: [Object] },
    name: 'nine of coins',
    rank: 9,
    suit: 'coins',
    reversed: true },
  { keywords: 
     [ 'wholeness',
       'integration',
       'totality',
       'completeness',
       'fullness' ],
    meanings: { light: [Object], shadow: [Object] },
    name: 'The World',
    rank: 21,
    suit: 'major',
    reversed: true },
  { keywords: [ 'implementation', 'action', 'exploration' ],
    meanings: { light: [Object], shadow: [Object] },
    name: 'three of wands',
    rank: 3,
    suit: 'wands',
    reversed: false } ]
*/

exports

tarotDeck

An array of objects representing tarot cards. See above for an example of the fields these objects will contain.

majorArcana

An array of objects representing only the Major Arcana tarot cards. See above for an example of the fields these objects will contain.

minorArcana

An array of objects representing only the Minor Arcana tarot cards. See above for an example of the fields these objects will contain.

suits

An array of the 5 suits of Tarot

function getBySuit( string )

Function that returns an array of objects representing tarot cards which match the provided suit. See above for an example of the fields these objects will contain.

function getByRank( integer or string )

Function that returns a single object representing a tarot card which matches the provided rank. The rank should be an integer or evaluate to an integer. See above for an example of the fields this will contain.

function drawCard( { float reversedChance = 0.5, array deck = tarotDeck } )

Will choose a random card from the the provided array of tarot cards. If the deck argument is not provided then it will default to the the exported tarotDeck. This will also add a reversed field to the object, which is a boolean of whether the card was drawn reversed or not. The default odds for a reversed draw is 50%, but a reversedChance argument can be provided.

function drawReading( integter numberOfCards = 3, { float reversedChance = 0.5, array deck = tarotDeck } )

Will draw up to numberOfCards from the the supplied deck argument and return them as an array. If the deck argument is not provided then it will default to the the exported tarotDeck. These cards are not replaced in the deck after they are drawn, so all cards are guarunteed unique. They will also include the reversed field. The default odd for a reversed draw is 50%, but a reversedChance argument can be provided. The provided deck argument or its default are NOT modified in any way. Cards returned from this function will still exist in the deck.