unicode-playing-card-converter
v1.2.0
Published
Convert playing card notation to an unicode character, and vice versa
Downloads
3
Readme
unicode-playing-card-converter
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,
}); //=> '🂠'