@drhex/prime-x

1.0.5 • Public • Published

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);

Package Sidebar

Install

npm i @drhex/prime-x

Weekly Downloads

37

Version

1.0.5

License

MIT

Unpacked Size

8.62 kB

Total Files

5

Last publish

Collaborators

  • drhex