1.0.0 • Published 6 months ago

@saishravan/is-even v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

is-even

A tiny utility module that checks if a number is even. Useful for validation, filters, or mathematical utilities.

npm version Coverage Status


✨ Features

  • ✅ Lightweight & fast
  • ✅ 100% test coverage
  • ✅ Zero dependencies

📦 Installation

npm install is-even
# or
yarn add is-even

🧠 Usage

const isEven = require('is-even')

console.log(isEven(2)) // true
console.log(isEven(3)) // false

⚠️ Input Validation

  • Accepts only numbers
  • Throws an error on invalid input
isEven('4') // ❌ Throws: Input must be a number!

📂 Project Structure

is-even/
├── index.js          # Main module
├── __tests__/        # Unit tests
├── package.json
└── README.md

🧪 Running Tests

npm test             # Basic test run
npm run test:watch   # Watch mode
npm run test:coverage # Generate coverage report

📄 License

MIT © Sai Shravan


🙌 Contributing

Feel free to open issues, suggest features, or contribute code!

git clone https://github.com/yourusername/is-even.git
cd is-even
npm install

⭐️ Show Your Support

If you find this module useful, consider starring the repo on GitHub or sharing it with a fellow dev.