@drhex/prime-x
v1.0.5
Published
A package to compute and check for prime numbers within a specified range.
Downloads
15
Readme
Prime-x
A simple Node.js package to check for prime numbers and also compute prime numbers within a specified range.
Installation
You can install this package using npm:
npm install @drhex/prime-x@latest
Usage
const prime = require("@drhex/prime-x");
const lower = 30;
const upper = 59;
// Compute prime numbers within a specified range
const primesInRange = prime.computePrime(lower, upper);
console.log("Prime numbers:", primesInRange);
check if a number is a prime number.
const prime = require("@drhex/prime-x");
const number = 97;
const isPrime = prime.checkPrime(number); //returns true
console.log("The number is a prime number:", isPrime);