better-prime-number
v0.1.5
Published
this package is a package to check prime number.
Downloads
9
Maintainers
Readme
better-prime-number
This is a lib made to study and experiment with creating packages in NPM. :)
Usage
How to use dependencies.
commonJs
const { isPrime , findPrimeInLength } = require('better-prime-number');
console.log(isPrime(5))
console.log(findPrimeInLength({start:2, end: 100}))
ESmodules
import { isPrime , findPrimeInLength } from 'better-prime-number';
console.log(isPrime(5))
console.log(findPrimeInLength({start:2, end: 100}))
Result
{ message: ' 5 is a prime number', isPrime: true }
{
message: 'prime number between 2 and 100 is 25',
primeList: [
2, 3, 5, 7, 11, 13, 17, 19,
23, 29, 31, 37, 41, 43, 47, 53,
59, 61, 67, 71, 73, 79, 83, 89,
97
]
}
Features
- check prime number
- find prime number between length
Installation
Install the dependencies.
npm i better-prime-number
License
MIT