Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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.
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
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 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.
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.
Return true if the given number is even.
Install with npm:
$ npm install --save is-even
var isEven = require('is-even');
isEven(0);
//=> true
isEven('1');
//=> false
isEven(2);
//=> true
isEven('3');
//=> false
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Commits | Contributor |
---|---|
6 | jonschlinkert |
1 | noformnocontent |
(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#dev verb-generate-readme && verb
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
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on May 27, 2017.
FAQs
Return true if the given number is even.
The npm package is-even receives a total of 132,362 weekly downloads. As such, is-even popularity was classified as popular.
We found that is-even demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.