Checks if a string is palindromic.
As the module is available on npm, all you need to do is install it via its name:
npm install is-palindromic --save
Require it in your code like so:
const isPalin = require("is-palindromic");
The module exports a single function, which will always return a boolean. Specify your string in the first parameter. By default, it is case-sensitive, but by changing the second parameter to false
, it will be case-insensitive:
isPalin("abc CBA"); // false
isPalin("abc CBA", true); // false
isPalin("abc CBA", false); // true
Tests are done via ava
, are stored in their own file, and can be run by the following command:
npm test
We use Travis CI to ensure that the code passes all of its tests.
This module is similar to is-palindrome
, but is much simpler, has a case-sensitivity option, and accounts for Unicode