Skip to content

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

License

Notifications You must be signed in to change notification settings

codernibba/prime-num

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Version license download download Fork Star watch

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.
  • 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:

npm install prime-num
const {primeupto,primelength} = require('prime-num');

console.log(primeupto(5));   // 2,3,5
console.log(primelength(5));   // 3
console.log(primeupto(34));  // 2,3,5,7,11,13,17,19,23,29,31
console.log(primelength(34));  // 11
console.log(primeupto(25));  // 2,3,5,7,11,13,17,19,23
console.log(primelength(25));  // 9
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

Run

node index.js

See the Getting Started for a more detailed tutorial.

Documentation

Clone the project from github:

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

License

MIT, Copyright (C) 2020

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%