utf8-bar
npm install utf8-bar
Usage
const utf8Bar = ; ; // ██████▋; // █████████████▎; // ████████████████████
Reference
utf8Bar(characters, percentage)
characters
(number) - How many characters long string to return.percentage
(double) - What portion of the string to color.
Example
const utf8Bar = ; const chars = 10;const max = 100;for let i = 0; i <= max; i++ console;
outputs
▏▎▎▍▌▋▊▊▉██▏█▎█▎█▍█▌█▋█▊█▊█▉████▏██▎██▎██▍██▌██▋██▊██▊██▉██████▏███▎███▎███▍███▌███▋███▊███▊███▉████████▏████▎████▎████▍████▌████▋████▊████▊████▉██████████▏█████▎█████▎█████▍█████▌█████▋█████▊█████▊█████▉████████████▏██████▎██████▎██████▍██████▌██████▋██████▊██████▊██████▉██████████████▏███████▎███████▎███████▍███████▌███████▋███████▊███████▊███████▉████████████████▏████████▎████████▎████████▍████████▌████████▋████████▊████████▊████████▉██████████████████▏█████████▎█████████▎█████████▍█████████▌█████████▋█████████▊█████████▊█████████▉██████████