# lcm

> compute the least common multiple using Euclidean algorithm

Latest version **0.0.4** (published 2026-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install lcm
pnpm add lcm
yarn add lcm
bun add lcm
```

## Health

**Score 58/100 (C)** — status: active.

Positive: has types package; no vulnerabilities; recently updated; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2026-07-06 |
| First published | 2014-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/lcm) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Xiuyu Li |
| Maintainers | nickleefly |
| Keywords | lcm, math, euclidean |

## Links

- npm: https://www.npmjs.com/package/lcm
- Repository: https://github.com/nickleefly/node-lcm
- Issues: https://github.com/nickleefly/node-lcm/issues
- npm.io page: https://npm.io/package/lcm

## Dependencies (1)

- [gcd](https://npm.io/package/gcd.md) ^0.0.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2026-07-06
- 0.0.3 — 2014-05-22
- 0.0.2 — 2014-05-22
- 0.0.1 — 2014-05-22

## README

# lcm

Compute the least common multiple using
[Euclid's algorithm](http://en.wikipedia.org/wiki/Euclidean_algorithm).

[![Build Status](https://travis-ci.org/nickleefly/node-lcm.svg?branch=master)](https://travis-ci.org/nickleefly/node-lcm)

[![browser support](https://ci.testling.com/nickleefly/node-lcm.png)
](https://ci.testling.com/nickleefly/node-lcm)

# example

``` js
var lcm = require('lcm');
var n = lcm(21, 6);
console.log(n);
```

***

```
42
```

# methods

``` js
var lcm = require('lcm')
```

## lcm(a, b)

Return the least common multiple of the integers `a` and `b` using Euclid's
algorithm.

# install

With [npm](http://npmjs.org) do:

```
npm install lcm
```

# license

MIT

---
_Source: https://npm.io/package/lcm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
