oddguard

Returns
trueif the given number is an odd integer that does not exceed JavaScript’sNumber.MAX_SAFE_INTEGER.
Returns
trueif a number or string value is a finite number. Useful for regex matches, parsing, user input, and validation.
Please consider following this project's author, M R Kishore Kumar, and consider starring the project to show your :heart: and support.
Install
Install with npm:
$ npm install --save oddguardUsage
Works with strings or numbers.
const { isOdd, isNumber } = require('oddguard');
// Odd checks
console.log(isOdd('1')); //=> true
console.log(isOdd('3')); //=> true
console.log(isOdd(0)); //=> false
console.log(isOdd(2)); //=> false
// Number validation
console.log(isNumber(42)); //=> true
console.log(isNumber('3.14')); //=> true
console.log(isNumber('foo')); //=> false
console.log(isNumber(NaN)); //=> false
About
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm testAuthor
M R Kishore Kumar
License
Copyright © 2025, Rigial.
Released under the MIT License.