npm: possibly marvellous

unicode-playing-card-converter

1.2.0 • Public • Published

unicode-playing-card-converter

npm version Build Status Dependency Status devDependency Status

Convert playing card notation to an unicode character, and vice versa (coming soon).

Supported: Node.js 4+

const converter = require('unicode-playing-card-converter');
 
// Get U+1F0A1 PLAYING CARD ACE OF SPADES
converter('As'); //=> '🂡'
 
// Get U+1F0DD PLAYING CARD QUEEN OF CLUBS
converter('Qc'); //=> '🃝'
 
// Get U+1F0CF PLAYING CARD BLACK JOKER
converter('X'); //=> '🃏'
 
// Get U+1F0C9 PLAYING CARD NINE OF DIAMONDS
converter({
    type: 'card',
    suit: 'diamond',
    rank: 9,
}); //=> '🃉'
 
// Get U+1F0BF PLAYING CARD RED JOKER
converter({
    type: 'special',
    kind: 'joker',
    variation: 2,
}); //=> '🂿'
 
// Get U+1F0A0 PLAYING CARD BACK
converter({
    type: 'special',
    kind: 'back',
    variation: 0,
}); //=> '🂠'

Keywords

none

install

npm i unicode-playing-card-converter

Downloadsweekly downloads

0

version

1.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability