Installation npm install nth-factorial Import .cjs file extension const factorial = require('nth-factorial'); Usage const factorialNumber = factorial(5) console.log('factorialNumber is:', factorialNumber); // factorialNumber is: 120