What is is-even?
The is-even npm package is a simple utility that allows you to check if a number is even. It is useful for basic numerical validations and can be easily integrated into larger projects where such checks are necessary.
What are is-even's main functionalities?
Check if a number is even
This feature allows you to check if a given number is even. The function returns true if the number is even and false if it is not.
const isEven = require('is-even');
console.log(isEven(4)); // true
console.log(isEven(3)); // false
Other packages similar to is-even
is-odd
The is-odd package provides functionality to check if a number is odd. It is similar to is-even but focuses on odd numbers instead. It can be used in conjunction with is-even for comprehensive numerical checks.
lodash
Lodash is a utility library that provides a wide range of functions for common programming tasks, including numerical checks. The _.isEven function in lodash can be used to check if a number is even, similar to the is-even package, but lodash offers much more functionality beyond this.
number-is-nan
The number-is-nan package checks if a value is NaN (Not-a-Number). While it does not directly check for even numbers, it is often used in conjunction with numerical validation libraries like is-even to ensure comprehensive number validation.
is-even
Return true if the given number is even.
Install
Install with npm:
$ npm install --save is-even
Usage
var isEven = require('is-even');
isEven(0);
isEven('1');
isEven(2);
isEven('3');
About
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Contributors
Building docs
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb
Running tests
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 test
Author
Jon Schlinkert
License
Copyright © 2017, Jon Schlinkert.
Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on May 27, 2017.