UNPKG

cross-platform-terminal-characters

Version:
25 lines (18 loc) 488 B
#!/usr/bin/env node 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();