A simple package to check if a number is prime.
npm i @thelocalgodd/isprime
const { isPrime } = require('@thelocalgodd/isprime');
console.log(isPrime(17)); // true
console.log(isPrime(4)); // false
Returns true
if the number is prime, false
otherwise.
-
num
(number): The number to check
- (boolean):
true
if the number is prime,false
otherwise
MIT