# prime-num

> prime numbers

Latest version **2.0.1** (published 2020-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install prime-num
pnpm add prime-num
yarn add prime-num
bun add prime-num
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-06-09 |
| First published | 2020-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | letskhabar |
| Maintainers | vimalverma558 |
| Keywords | prime-num, prime, math |

## Links

- npm: https://www.npmjs.com/package/prime-num
- Repository: https://github.com/letskhabar/prime-num
- Homepage: https://github.com/letskhabar/prime-num#readme
- Issues: https://github.com/letskhabar/prime-num/issues
- npm.io page: https://npm.io/package/prime-num

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2020-06-09
- 2.0.0 — 2020-06-09
- 1.0.0 — 2020-06-08
- 0.0.1 — 2020-06-05

## README

prime-num is an math library for JavaScript and Node.js. It help you to find all prime number.

[![Version](https://img.shields.io/npm/v/prime-num)](https://www.npmjs.com/package/prime-num)
[![license](https://img.shields.io/npm/l/prime-num)](https://www.npmjs.com/package/prime-num)
[![download](https://img.shields.io/npm/dw/prime-num)](https://www.npmjs.com/package/prime-num)
[![download](https://img.shields.io/npm/dt/prime-num)](https://www.npmjs.com/package/prime-num)
[![Fork](https://img.shields.io/github/forks/letskhabar/prime-num?label=fork&style=social)](https://github.com/letskhabar/prime-num/fork)
[![Star](https://img.shields.io/github/stars/letskhabar/prime-num?style=social)](https://github.com/letskhabar/prime-num/stargazers)
[![watch](https://img.shields.io/github/watchers/letskhabar/prime-num?style=social)](https://github.com/letskhabar/prime-num/watchers)


## Features

- find all prime number upto n. [ primes(n) ]
- find all prime number between m to n. [ primebtw(m,n) ]
- find number of prime upto n.  [ primelength(n) ]
- find number of prime between m to n. [ primebl(m,n) ]
- find a number n is Prime or not.  [ isPrime(n) ]

- Can be used in command line as well.
- Runs on any JavaScript engine.
- Is easily extensible.
- Open source.

## Usage

prime-num can be used in both node.js and in the browser.

Install prime-num using [npm](https://www.npmjs.com/package/prime-num):

    npm install prime-num


```js
const {primes,primelength,isPrime,primebtw,primebl} = require('prime-num');

console.log(primes(25));       // 2,3,5,7,11,13,17,19,23
console.log(primelength(25));  // 9
console.log(isPrime(25));      // false
console.log(primes(53));       // 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53
console.log(primelength(53));  // 16
console.log(isPrime(53));      // true
console.log(primebtw(53,10));  // 11,13,17,19,23,29,31,37,41,43,47,53
console.log(primebl(53,10));   // 12
```

## Run

```
node index.js
```

See the [Getting Started](https://github.com/letskhabar/prime-num) for a more detailed tutorial.


## Documentation

- [Getting Started](https://github.com/letskhabar/prime-num)
- [Examples](#)
- [Overview](https://github.com/letskhabar/prime-num)
- [History](#)



Clone the project from github:

    git clone https://github.com/letskhabar/prime-num.git
    cd prime-num





## License
MIT,  Copyright (C) 2020

---
_Source: https://npm.io/package/prime-num · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
