@amanprasad/odd-even-checker
v1.0.1
Published
A simple package to check if a number is odd or even
Downloads
15
Readme
@amanprasad/odd-even-checker
A simple utility function to check whether a number is odd or even.
Installation
To install this package, run the following command:
npm install @amanprasad/odd-even-checker
Usage
To use this package in your project, you can import the function and use it as follows:
Example
// Import the function
const isOddOrEven = require('@amanprasad/odd-even-checker');
// Check if a number is odd or even
const result = isOddOrEven(10);
console.log(result); // Output: "even"
isOddOrEven("not-a-number"); // Throws Error: "Input must be a number"
License
This project is licensed under the MIT License.
This `README.md` gives a clear overview of the package's functionality, installation instructions, usage examples, and error handling.