Socket
Book a DemoInstallSign in
Socket

divisors-and-multiples

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

divisors-and-multiples

A simple npm package that allows you to get all the divisors of a number (1-1000) or multiples from the number itself to the number * 100!

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

Divisors And Multiples

What is this package, and what does it do?

  • This is a simple package that allows you to get all the numbers a number can be divided with, or get all the multiples of anynumber!

Installation

npm install divisors-and-multiples

Usage

const divisorsAndMultiples = require('divisors-and-multiples'); // requiring the package

console.log(divisorsAndMultiples.findDivisors(6)); // output: [1, 2, 3, 6]

console.log(divisorsAndMultiples.findMultiples(4)); // output: [4, 8, 12, 16,..., 400]

NOTE

  • The limit for the number in findDivisors and findMultiples is 99,999,999. One of the reasons that number is max is speed.
  • Depending on the number you give, the functions go and try to divide/multiply your number with every number from 1 to 99,999,999 so it makes our code run slower if the number is bigger...

Keywords

JavaScript

FAQs

Package last updated on 05 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.