@m0n0lab/is-even
v2.1.4
Published
[](https://www.npmjs.com/package/@m0n0lab/is-even) [](https://codecov.io/gh/pabloimrik17/monolab?flag=is
Readme
@m0n0lab/is-even
A simple, well-tested utility to check if a number is even. Perfect for number validation, mathematical operations, conditional logic, and filtering.
Features
- 🎯 Simple and intuitive API
- ✅ Fully typed with TypeScript
- 🧪 100% test coverage
- 📦 Zero dependencies
- ⚡ Lightweight and fast
- 🔒 Secure and reliable
- 🚀 Production ready
- 📘 Well documented
Installation
npm
npm install @m0n0lab/is-evenpnpm
pnpm add @m0n0lab/is-evenJSR
npx jsr add @m0n0lab/is-evenUsage
import { isEven, isNotEven } from "@m0n0lab/is-even";
// Check if a number is even
console.log(isEven(2)); // true
console.log(isEven(3)); // false
console.log(isEven(0)); // true
// Check if a number is not even (odd)
console.log(isNotEven(3)); // true
console.log(isNotEven(2)); // false
console.log(isNotEven(1)); // trueAPI
isEven(value: number): boolean
Returns true if the number is even, false otherwise.
isNotEven(value: number): boolean
Returns true if the number is not even (i.e., odd), false otherwise.
License
MIT
