{"id":18143273,"url":"https://github.com/untool/duplitect","last_synced_at":"2026-04-26T05:30:19.091Z","repository":{"id":34233179,"uuid":"172277613","full_name":"untool/duplitect","owner":"untool","description":"A CLI (and API) tool to detect and prevent duplicate versions of installed JavaScript packages.","archived":false,"fork":false,"pushed_at":"2024-05-10T13:20:49.000Z","size":1018,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T04:12:38.118Z","etag":null,"topics":["cli","library","npm","utility","yarn"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/duplitect","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/untool.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-24T00:03:36.000Z","updated_at":"2021-06-14T04:36:18.000Z","dependencies_parsed_at":"2024-06-21T03:55:58.743Z","dependency_job_id":null,"html_url":"https://github.com/untool/duplitect","commit_stats":{"total_commits":156,"total_committers":6,"mean_commits":26.0,"dds":"0.21794871794871795","last_synced_commit":"9166c22dee5e2ac7b68edbd6175d7ae23e2ebb4a"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/untool%2Fduplitect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/untool%2Fduplitect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/untool%2Fduplitect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/untool%2Fduplitect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/untool","download_url":"https://codeload.github.com/untool/duplitect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240054717,"owners_count":19740873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","library","npm","utility","yarn"],"created_at":"2024-11-01T19:06:18.924Z","updated_at":"2026-04-26T05:30:19.056Z","avatar_url":"https://github.com/untool.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# duplitect\n\n[![travis](https://img.shields.io/travis/untool/duplitect/master.svg)](https://travis-ci.org/untool/duplitect)\u0026nbsp;[![npm](https://img.shields.io/npm/v/duplitect.svg)](https://www.npmjs.com/package/duplitect) \u003cbr/\u003e\n\n`duplitect` is a simple tool to detect duplicate versions of installed packages. JavaScript package managers such as [NPM](https://www.npmjs.com/get-npm) and [Yarn](https://yarnpkg.com/en/) habitually allow you to install multiple versions of (transient) dependencies. This works most of the time - for certain kinds of packages, it does not.\n\n`untool` happens to be among these packages that have to be installed exactly once inside any given project, which is why we built this module.\n\n### Installation\n\nUsing [NPM](https://www.npmjs.com/get-npm):\n\n```text\nnpm install -S duplitect\n```\n\nUsing [Yarn](https://yarnpkg.com/en/):\n\n```text\nyarn add duplitect\n```\n\n### CLI\n\nUsually, you will want to use `duplitect` as a CLI tool. Since most typical Node.js projects contain a significant number of (unproblematic) duplicates, you will probably want to limit `duplitect`'s output by passing one or more patterns.\n\n##### Example\n\n```text\n$ duplitect untool @untool*\nDuplicate: untool\nDuplicate: @untool/core\n```\n\n`duplitect` supports the wildcard character `*` as shown above. This allows you to match multiple, possibly scoped, packages at once.\n\n### API\n\nYou can also use `duplitect` in your own tools - it exposes two functions: one, that mimics the CLI functionality. And a second one, that additionally provides the versions of the duplicates.\n\n#### `getDuplicates(cwd, [pattern, pattern, ...])`\n\n```javascript\nconst { getDuplicates } = require('duplitect');\n\nconst duplicates = getDuplicates(process.cwd(), 'untool', '@untool*');\nduplicates.forEach((duplicate) =\u003e console.log(`Duplicate: ${duplicate}`));\n```\n\n#### `getDuplicatesDetails(cwd, [pattern, pattern, ...])`\n\n```javascript\nconst { getDuplicatesDetails } = require('duplitect');\n\ngetDuplicatesDetails(process.cwd(), 'untool', '@untool*').then((duplicates) =\u003e\n  duplicates.forEach(({ name, version, pathName }) =\u003e\n    console.log('name: %s, version: %s, pathName: %s', name, version, pathName)\n  )\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funtool%2Fduplitect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funtool%2Fduplitect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funtool%2Fduplitect/lists"}