Quantcast
Channel: How to output emoji to console in Node.js (on Windows)? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

How to output emoji to console in Node.js (on Windows)?

$
0
0

On Windows, there's some basic emoji support in the console, so that I can get a monochrome glyph if I type, e.g. or 📜. I can output a string from PowerShell or a C# console application or Python and they all show those characters fine enough.

However, from Node.js, I can only get a couple of emoji to display (e.g. ), but not other (instead of 📜 I see ). However, if I throw a string with those characters, they display correctly.

console.log('📜☕');throw '📜☕';

If I run the above script, the output is

�☕C:\Code\emojitest\emojitest.js:2throw '📜☕'; ^📜☕

Is there anyway that I can output those emojis correctly without throwing an error? Or is that exception happening outside of what's available to me through the standard Node.js APIs?


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>