https://github.com/draeder/pryme
Check if a number is prime
https://github.com/draeder/pryme
Last synced: about 1 month ago
JSON representation
Check if a number is prime
- Host: GitHub
- URL: https://github.com/draeder/pryme
- Owner: draeder
- License: mit
- Created: 2022-07-22T01:02:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-24T13:37:02.000Z (almost 3 years ago)
- Last Synced: 2025-03-12T22:16:07.326Z (about 2 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pryme
## Check if a number is primePryme uses the optimizations documented [here](https://stackoverflow.com/a/17579161/1551027).
## Install
```
npm i pryme
```## Usage
```js
let isPrime = pryme(101) // true
```## Example
```js
import pryme from 'pryme'let isPrime = pryme(1000000000001003)
console.log(isPrime) // true
```## CLI
### Install
```js
npm i pryme -g
```### Usage
```js
$ pryme 1
1 is prime? false
pryme > 101
101 is prime? true
pryme > // wait for new input
```## Licence
MIT