# @hyrious/dup

> Find duplicates in your lockfile

Latest version **0.1.8** (published 2026-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hyrious/dup
pnpm add @hyrious/dup
yarn add @hyrious/dup
bun add @hyrious/dup
```

Provides the command `dup`.

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2026-10-08 |
| First published | 2023-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | hyrious <hyrious@outlook.com> |
| Maintainers | hyrious |
| Keywords | dedupe, deduplicate, lockfile, package-lock.json, yarn.lock, pnpm-lock.yaml |

## Links

- npm: https://www.npmjs.com/package/@hyrious/dup
- Repository: https://github.com/hyrious/dup
- npm.io page: https://npm.io/package/@hyrious/dup

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 0.1.8 (latest) — 2026-10-08
- 0.1.7 — 2025-09-04
- 0.1.6 — 2025-03-26
- 0.1.5 — 2024-05-20
- 0.1.4 — 2024-05-09
- 0.1.3 — 2024-04-28
- 0.1.2 — 2024-03-15
- 0.1.1 — 2024-02-08
- 0.1.0 — 2023-12-14

## README

# @hyrious/dup

Find duplicates in your package-lock.json / pnpm-lock.yaml.

This script is using string matching, it is very fast.

## Usage

<pre><code>$ cd path/to/your/npm-project
$ <a href="https://github.com/antfu/ni">nlx</a> @hyrious/dup
foo@1.0.0
foo@2.0.0</code></pre>

### Next Steps

You can run <code><a href="https://github.com/antfu/ni">na</a> why {package-name}</code>
to find out why they are there in your dependencies tree.

- The duplicates are likely to happen after you have run
  <code><a href="https://github.com/antfu/taze">taze</a> -wi</code>. This is
  because package managers tend to keep indirect dependencies' versions if
  updating them is not necessary and for smaller downloading footprint.

  You can run <code><a href="https://github.com/antfu/ni">na</a> dedupe</code>
  to force update all dependencies to the same version (if possible).

- Some modules may deploy their function and CLI in the same package, which
  results in the CLI's dependencies (`yargs`, `commander`, etc.) being included
  in your dependencies tree and you actually does not need them.

  You can add [overrides](https://pnpm.io/settings#overrides) to remove
  them, for example (in pnpm-workspace.yaml):

  ```yaml
  overrides:
    "critters>chalk": "-"
    "html-minifier>commander": "-"
  ```

  Or in [package.json](https://docs.npmjs.com/cli/v12/configuring-npm/package-json#overrides)
  (for npm):

  ```json
  "overrides": {
    "chalk": "npm:noop-package@1.0.0",
    "commander": "npm:noop-package@1.0.0"
  }
  ```

- If an indirect dependency's newer version breaks your codebase, you can either

  - Hack into it (if possible) in your codebase and alter its behavior;
  - Make a [patch](https://pnpm.io/cli/patch) to fix it manually;
  - Raise an issue to the package's repo.

  I'm just encouraging you to use less dependencies to risk less.

- Bonus: run `DUP_EVIL=1 dup` to add overrides to all duplicate dependencies.
  It's _evil_ since things may break because of dependencies getting newer.

## License

MIT @ [hyrious](https://github.com/hyrious)

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