Skip to content

haykam821/Is-Palindromic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Is Palindromic

GitHub release npm Travis (.com)

Checks if a string is palindromic.

Installation

As the module is available on npm, all you need to do is install it via its name:

npm install is-palindromic --save

Usage

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

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.

Similar Work

This module is similar to is-palindrome, but is much simpler, has a case-sensitivity option, and accounts for Unicode