https://github.com/letskhabar/primeupto
primeupto is an math library for JavaScript and Node.js. It help you to find all prime number.
https://github.com/letskhabar/primeupto
hacktoberfest javascript letskhabar math-library npm npm-module npm-package open-source opensource prime prime-upto
Last synced: 22 days ago
JSON representation
primeupto is an math library for JavaScript and Node.js. It help you to find all prime number.
- Host: GitHub
- URL: https://github.com/letskhabar/primeupto
- Owner: letskhabar
- License: mit
- Created: 2020-06-03T04:36:50.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T07:22:13.000Z (almost 5 years ago)
- Last Synced: 2025-04-12T00:43:43.927Z (22 days ago)
- Topics: hacktoberfest, javascript, letskhabar, math-library, npm, npm-module, npm-package, open-source, opensource, prime, prime-upto
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/primeupto
- Size: 6.84 KB
- Stars: 7
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
primeupto is an math library for JavaScript and Node.js. It help you to find all prime number.
[](https://www.npmjs.com/package/primeupto)
[](https://www.npmjs.com/package/primeupto)
[](https://www.npmjs.com/package/primeupto)
[](https://www.npmjs.com/package/primeupto)
[](https://github.com/letskhabar/primeupto/fork)
[](https://github.com/letskhabar/primeupto/stargazers)
[](https://github.com/letskhabar/primeupto/watchers)## Features
- find all prime number upto n.
- find all prime number from m to n. // comming soon
- find number of prime upto n.
- find number of prime from m to n.
- find a number is Prime or not.
- Can be used in command line as well.
- Runs on any JavaScript engine.
- Is easily extensible.
- Open source.## Usage
primeupto can be used in both node.js and in the browser.
Install primeupto using [npm](https://www.npmjs.com/package/primeupto):
npm install primeupto
```js
const {primeupto,primelength,isPrime} = require('primeupto');console.log(primeupto(5)); // 2,3,5
console.log(primelength(5)); // 3
console.log(isPrime(5)); // true
console.log(primeupto(34)); // 2,3,5,7,11,13,17,19,23,29,31
console.log(primelength(34)); // 11
console.log(isPrime(34)); // false
console.log(primeupto(25)); // 2,3,5,7,11,13,17,19,23
console.log(primelength(25)); // 9
console.log(isPrime(25)); // false
console.log(primeupto(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```
## Run
```
node index.js
```See the [Getting Started](https://github.com/letskhabar/primeupto) for a more detailed tutorial.
## Documentation
- [Getting Started](https://github.com/letskhabar/primeupto)
- [Examples](#)
- [Overview](https://github.com/letskhabar/primeupto)
- [History](#)Clone the project from github:
git clone https://github.com/letskhabar/primeupto.git
cd primeupto## License
MIT, Copyright (C) 2020