Is 57 a prime number? hopefully, { prime: false }
Install with npm
$ npm install @hprogrammers/is-primeimport isPrime from '@hprogrammers/is-prime';
isPrime(1); // { prime: false }
isPrime(2); //{ prime: true }
isPrime(3); // { prime: true }This is also a 1009% (as 1000 is not a prime) serious project like the is-even project. Currently it can't check all the prime numbers, hopefully someday it will...
N.B: It's not recommended to use this package anywhere on your code, please use a proper algorithm.
Prime not listed? We know. Wanna add it? Open an issue or PR - we're always looking for more primes to add to our database!
Read the Contributing Guidelines
Copyright © 2026, Hero Programmers. Released under the MIT License.