@mia-cx/primes
v0.0.4-a
Published
yet another prime generator package with caching. computes prime numbers using trial division.
Downloads
8
Maintainers
Readme
@mia-cx/primes
a fairly performant prime generator by @mia-cx
Installation
Using npm:
npm i @mia-cx/primes
Using pnpm:
pnpm i @mia-cx/primes
Usage
commonjs
const generatePrimes = require('@mia-cx/primes');
console.log(generatePrimes(100)); // returns 100 primes
console.log(generatePrimes(100, 200)); // returns prime numbers between 100 and 200
esm
import isPrime from "@mia-cx/primes";
console.log(generatePrimes(100)); // returns an array of 100 primes
console.log(generatePrimes(100, 200)); // returns an array of prime numbers between 100 and 200