If you are not familiar with the Node.js leftpad debacle, essentially someone wrote a single function to format a string to particular length, adding spaces to the left. He exported this function as a library and thousands of projects depended on it. After he removed his library, thousands of projects failed to build because they were missing this one simple function.
Thankfully, there are no worries here as reprint supports left pad!
reprintf("\f5r", 42);
printf("%5i", 42);
In this case, we are printing out 42 with a column width of 5. This pads 3 space ' ' characters before the 42. The pad character can be arbitrary (unlike printf), but that is another post.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.