So, I needed to pad some strings for a project I was working on, and I remembered left-pad. Thing is, it only pads to the left.... I needed more features, including: padding to the right, padding to the left and right at the same time with the same character(s) (did I mention it can pad strings too instead of singular characters??), pad in both directions independently in one line of code. That's why I wrote paddery: to fix what I think is broken. Yes, I know, a lot of other padding tools exist, but I couldn't fathom how cool having an NPM package would be and how easy it was to code. Personally, I'm going to take the Linus approach: if someone down the line makes a padder library that's better than mine, I will stop development and use that. Sure, the community will and can maintain it after I stop development, but I personally am going to move to the better package. But until then, you and I can use this wonderful package.
Anyways, with that out of the way, I built it in an afternoon! Not to say it's anything crazy, but I genuinely needed a quick fix and that's exactly what I got! I'm sharing it with you guys so you can use it too and help me improve it:
GitHub: https://github.com/segfault-elf/paddery
NPM: paddery
- segfault.elf
Top comments (0)