cross-platform-terminal-characters
Version:
All the characters that work on most terminals
25 lines (18 loc) • 488 B
JavaScript
import{codepoints}from"./main.js";
import{serializeHex}from"./serialize.js";
const runCli=()=>{
const output=codepoints.
filter(shouldBePrinted).
map(serializeCodepoint).
join("\n");
console.log(output)
};
const shouldBePrinted=(codepoint)=>codepoint>MAX_C0_CODEPOINT;
const MAX_C0_CODEPOINT=31;
const serializeCodepoint=(codepoint)=>{
const hex=serializeHex(codepoint);
const character=String.fromCodePoint(codepoint);
return`${hex} ${character}`
};
runCli();