You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A string representing the semantic version number.
swapCase(text)
This function takes a string of text and swaps the case for each letter: lowercase letters become uppercase letters, and vice versa. All the Unicode ‘Full’ case folding mappings are used.
swapcase.encode('aBcDeFg');// → 'AbCdEfG'
Using the swapcase binary
To use the swapcase binary in your shell, simply install swapcase globally using npm:
npm install -g swapcase
After that you will be able to case-swap text from the command line:
$ swapcase 'föo ♥ bår 𝌆 baz'
FÖO ♥ BÅR 𝌆 BAZ
Read a local text file, case-swap any letters it contains, and save the result to a new file:
swapcase has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.
Unit tests & code coverage
After cloning this repository, run npm install to install the dependencies needed for swapcase development and testing. You may want to install Istanbul globally using npm install istanbul -g.
Once that’s done, you can run the unit tests in Node using npm test or node tests/tests.js. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use grunt test.
To generate the code coverage report, use grunt cover.