Find all prime numbers in a given range.
npm install prime-finder
import { findPrimes } from 'prime-finder';
findPrimes({ limit: 1000000000, log: true, timePrecision: 2 });
Options should be passed as an object to findPrimes
.
limit
- upper bound of the range. Default = 999start
- lower bound of the range. Default = 1timePrecision
- number of decimal places to show in time stamps. Default = 3log
- log a console message each time a new prime is found. Default = falselogAllOnFish
- iterates through all primes found upon completion. Default = false
Note: logs will slow down how fast new numbers are discovered.