First install it:
# npmnpm install --save spongebobify# yarn (better)yarn add spongebobify
Alternatively, use it from the web with unpkg.
Then require and use it:
;console;// will print "a nOdE mOdUlE To eAsIlY SpOnGeBoBiFy TeXt"// you can also specify a param on case alternationconsole;// will print same as aboveconsole;// will print "A NoDe mOdUlE To eAsIlY SpOnGeBoBiGy tExT"
# Build UMD and ESM modulesyarn build# Run Mocha test-suiteyarn test
Q: Why does this exist?
A: WhY dOeS tHiS eXiSt?
Q: Why do you need type safe spongebobification?
A: Our 10s of users depend on us to deliver a reliable package that will never cause issues. Type checking allows us to deliver on that promise.
Q: Couldn't you just have a human test the code?
A: Clearly, we hold ourselves to higher standards than you hold yourself.
Q: Couldn't I just write this algorithm myself?
A: What would you rather do - write 5 lines of code or just type
yarn add spongebobify and get a package guaranteed to work after installing.
Q: Why is there a rollup config file?
A: Welcome to the future.
Algorithm and idea inspired by Irfaan Khalid's spongebobify-cmd project. His isn't as good though - there's no unit tests, it's not available on Maven and it's in Java.