is-evenly
v1.0.3
Published
Small NPM Package to Detect if the Number is Even Or Not
Downloads
207
Readme
is-evenly
A simple and lightweight NPM package to determine if a number is even or not.
Installation
Install the package via npm:
npm install is-evenly
Usage
Here’s how you can use the is-evenly package in your project:
const even = require('is-evenly');
console.log(even(4)); // OUTPUT: true
console.log(even(3)); // OUTPUT: false
Features
- Lightweight and fast.
- Works with positive and negative integers.
- Returns a boolean value indicating whether the number is even.
const even = require('is-evenly');
// Check even numbers
console.log(even(2)); // true
console.log(even(10)); // true
// Check odd numbers
console.log(even(3)); // false
console.log(even(-7)); // false
// Edge case: Zero
console.log(even(0)); // true
API
even(number) number: A numeric value to check. Must be a finite integer. Returns true if the number is even, false otherwise. License This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! If you’d like to improve this package, feel free to submit a pull request or open an issue on GitHub 👨💻.