@namadhre/is-prime
v1.0.2
Published
Package for is Prime number
Downloads
5
Readme
🔢 @namadhre/is-prime
A simple and lightweight Node.js utility to check whether a number is a prime.
📦 Installation
npm install @namadhre/is-prime🚀 Usage
const { isPrime } = require('@namadhre/is-prime');
console.log(isPrime(7)); // true
console.log(isPrime(10)); // false🧠 API Reference
isPrime(number)
- Parameters:
number(Number): The number to check.
- Returns:
trueif the number is prime,falseotherwise.
📖 Example
const { isPrime } = require('@namadhre/is-prime');
for (let i = 1; i <= 20; i++) {
console.log(`${i} is prime? `, isPrime(i));
}🧾 License
This project is licensed under the MIT License.
🙋♂️ Author
Made with ❤️ by Mahendra Chinthamgari
🔗 GitHub
