primes-simple
v1.0.1
Published
Simple prime number and prime factorization package
Downloads
9
Maintainers
Readme
npm-primes-simple: Node.js Package for Prime Factorization
A simple Node.js package for either testing whether a number is prime, or returning the prime factors if a number is not prime.
Installing
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Install package with:
npm install --save primes-simple
In example.js
, a few examples are shown.
To run:
const primes = require('primes-simple')
let num = getRandomInt(10000,1000000) //or any num
prime(num)
Running Tests
index.test.js
provides three tests for benchmarking purposes, and personalized tests may be generated. Simply follow the sytax, making sure to use assert.deepEqual
.
If the dependency for running tests (Mocha) is properly installed, simply write your tests and run npm run test
in the console/terminal.
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE.md file for details