Measure the width of text in the terminal and build simple layouts!
0

Configure Feed

Select the types of activity you want to include in your feed.

string_width / bench / sindre.mjs
245 B 9 lines
1import string_width from 'string-width' 2 3let sum = 0; 4for(let i = 0; i < 1000000; ++i) { 5 sum += string_width("\x1b[1;95m· \x1b[0m\x1b[K\x1b[33mdeno\x1b[0m\x1b[K, \x1b[33mtypescript\x1b[0m\x1b[K, \x1b[33mts\x1b[0m\x1b[K") 6} 7console.log(sum) 8 9