Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

pfactor

Find prime factors.

prime, factors, prime factorization

readme

NPM version License NPM monthly downloads NPM total downloads Github Link

pFactor

A simple tool to return prime factors of a given number

Install:

npm install pfactor

Usage:

const pFactor = require('pfactor');

console.log(pFactor(12));

This will log the prime factors as an array (in ascending order): [2,2,3]