https://github.com/psenger/palindrome
A simple Palindrome project with full test code coverage
https://github.com/psenger/palindrome
Last synced: 7 months ago
JSON representation
A simple Palindrome project with full test code coverage
- Host: GitHub
- URL: https://github.com/psenger/palindrome
- Owner: psenger
- Created: 2015-11-03T12:39:05.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-03T20:40:54.000Z (about 10 years ago)
- Last Synced: 2024-04-14T14:29:56.425Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 148 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# palindrome
A simple NodeJS v4.0.0 app written to test if a string is a Palindrome without reversing it. I used Mocha with BDD style tests, istanbul to validate code coverage, NPM to bump the version and create a release so it can linked into a node project with NPM, and used Travis CI for CI.
[](https://travis-ci.org/psenger/palindrome)
## How to run the test
Install node js [here](https://nodejs.org/en/)
Install git [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
Then clone this project with git
```
git clone https://github.com/psenger/palindrome.git
```
then **cd** into the newly checked out directory
```
cd palindrome
```
and execute the following
```
npm install
npm test
```
The tests will run, and code coverage will be included in the output.
## Documentation
You can link this project directly into a NPM project via by using this package.json file. Replace xxxxxxxx with your Github Personal access tokens.
```js
"devDependencies": {
"palindrome": "git+https://xxxxxxxx:x-oauth-basic@github.com/psenger/palindrome.git",
}
```
## palindromic
This module contains variations of the Palindrome functions
**Author:** Philip A Senger
### palindromic.isPalindrome(aString) ⇒ boolean
Test if a string is a Palindrome
**Kind**: static method of [palindromic](#module_palindromic)
**Api**: public
| Param | Type | Description |
| --- | --- | --- |
| aString | string | The string value a Palindrome test, numbers, null, undefined, and functions will return false. |
**Example**
```js
if ( palindrome.isPalindrome ( "a toyotas a toyota" ) {
console.log( 'yes' );
}
```
**Example**
```js
if ( palindrome.isPalindrome ( "1221" ) {
console.log( 'yes' );
}
```
**Example**
```js
if ( palindrome.isPalindrome ( "abBA" ) {
console.log( 'yes' );
}
```