/nth-prime

A simple npm package with a function that returns the nth prime number

Primary LanguageJavaScriptMIT LicenseMIT

nth-prime Build Status codecov Maintainability

A simple npm package with a function that returns the nth prime number.

Installation

npm i -S nth-prime

Usage

var nthPrime = require('nth-prime');

console.log(nthPrime(1)); // prints 2
console.log(nthPrime(2)); // prints 3
console.log(nthPrime(5)); // prints 11
console.log(nthPrime(1000000));  // prints 15485863