{"id":24319522,"url":"https://github.com/ryym/node-depcop","last_synced_at":"2025-07-25T04:34:32.472Z","repository":{"id":66203964,"uuid":"52365880","full_name":"ryym/node-depcop","owner":"ryym","description":"Validate 'dependencies' and 'devDependencies' in your package.json","archived":false,"fork":false,"pushed_at":"2024-02-09T14:45:34.000Z","size":178,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T23:51:48.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ryym.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":"2016-02-23T14:44:55.000Z","updated_at":"2024-02-09T14:45:39.000Z","dependencies_parsed_at":"2024-11-11T11:02:42.466Z","dependency_job_id":"bfaab753-bfd0-4dde-adc9-22b086647868","html_url":"https://github.com/ryym/node-depcop","commit_stats":{"total_commits":203,"total_committers":2,"mean_commits":101.5,"dds":"0.0049261083743842304","last_synced_commit":"391df867bafa4ec3244790122697f113b9145cc9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryym%2Fnode-depcop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryym%2Fnode-depcop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryym%2Fnode-depcop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryym%2Fnode-depcop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryym","download_url":"https://codeload.github.com/ryym/node-depcop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242728640,"owners_count":20175935,"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":[],"created_at":"2025-01-17T15:33:38.910Z","updated_at":"2025-03-10T20:41:10.221Z","avatar_url":"https://github.com/ryym.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Depcop - Validate dependencies in package.json\n\n[![npm](https://img.shields.io/npm/v/depcop.svg)][npm-version]\n[![Travis](https://img.shields.io/travis/ryym/node-depcop/master.svg)][travis-ci]\n[![Appveyor](https://ci.appveyor.com/api/projects/status/geea51i0a86loy24/branch/master?svg=true)][appveyor]\n[![Coveralls](https://img.shields.io/coveralls/ryym/node-depcop.svg)][coveralls]\n[![David](https://img.shields.io/david/ryym/node-depcop.svg)][david]\n[![David dev](https://img.shields.io/david/dev/ryym/node-depcop.svg)][david-dev]\n\n[![License](http://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n[![docs](http://img.shields.io/badge/to-docs-blue.svg)](/docs)\n\n[npm-version]: https://www.npmjs.org/package/depcop\n[travis-ci]: https://travis-ci.org/ryym/node-depcop\n[appveyor]: https://ci.appveyor.com/project/ryym/node-depcop/branch/master\n[coveralls]: https://coveralls.io/github/ryym/node-depcop?branch=master\n[david]: https://david-dm.org/ryym/node-depcop\n[david-dev]: https://david-dm.org/ryym/node-depcop#info=devDependencies\n\nDepcop is a tool to validate your `dependencies` and `devDependencies` in a `package.json`.\nIt checks your source code and warns if some dependency definitions are missing,\nunused, or listed in a wrong group.\n\n## Validations\n\n### [Missing module check]\n\nMakes sure:\n\n* all modules used in source code are listed in `dependencies` or `devDependencies`\n\n### [Unused module check]\n\nMakes sure:\n\n* `dependencies` and `devDependencies` don't contain modules used in any source\n\n### [Strayed module check]\n\nMakes sure:\n\n* `dependencies` don't contain modules used only in development code\n* `devDependencies` don't contain modules used in library code\n\n#### Note: definition of terms\n\n| term | description |\n|:-----|:------------|\n| library code     | Ordinary source files usually put in `./lib`. |\n| development code | Test files, config files, or build scripts like `gulpfile.js`. |\n\nFor more details about validations, please see [Validations].\n\n## Features\n\n* ES2015 style support (`import` declarations)\n* CommonJS style support (`require` expressions)\n* Configurable\n\n## Installation\n\nYou can install Depcop using npm.\n\n```\nnpm install --save-dev depcop\n```\n\n## Usage\n\nYou can use Depcop via [CLI] or [Node.js API].\nPlease see [Usage] for details.\n\n```sh\n# CLI\ndepcop --missing --unused -l 'lib/**/*.js' -d 'test/**/*.js','gulpfile.js'\n```\n\n```js\n// JS\nimport { makeDepcop } from 'depcop';\n\nconst depcop = makeDepcop({\n  options: {\n    libSources: ['lib/**/*.js'],\n    devSources: ['test/**/*-test.js'],\n    checks: {\n      unused: {\n        ignore: ['istanbul', 'mocha']\n      }\n    }\n  }\n});\n\nconst result = depcop.runValidations();\n\n// ..\n```\n\n## Configuration\n\nYou can write a configuration file to configure Depcop.\nPlease see [Configuring Depcop] for details.\n\n```js\n// .depcoprc.js\nmodule.exports = {\n  libSources: [\n    'lib/**/*.js'\n  ],\n  devSources: [\n    'test/**/*-test.js',\n    'gulpfile.babel.js'\n  ],\n  checks: {\n    missing: {\n      ignore: [/alias.+/]\n    },\n    unused: {}\n  }\n};\n```\n\n## Why?\n\nIt is usually difficult to notice that some dependency definitions are missing (or unused)\nin local environment where necessary dependencies have been installed. Especially, it is\nso difficult to notice when you accidentally define a module in `devDependencies` which is\nactually used in library code. In this case, all tests will pass in both of local and CI environment\nwhere `devDependencies` will be installed.\nAnd it is not until the module is installed to user environments where\n`devDependencies` doesn't be installed that it causes an error for lack of dependencies.\nThe goal of this module is to prevent such a tragedy.\n\n## Similar projects\n\n* [dependency-check] - A CLI tool to check missing or unused dependencies.\n* [require-lint] - A CLI tool which also supports [CoffeeScript].\n* [eslint-plugin-node] - A ESLint plugin for Node.js. Linting dependencies is one of its features.\n\n[Missing module check]: /docs/validations.md#missing-module-check\n[Unused module check]: /docs/validations.md#unused-module-check\n[Strayed module check]: /docs/validations.md#strayed-module-check\n\n[Validations]: /docs/validations.md\n[Usage]: /docs/usage.md\n[CLI]: /docs/usage.md#command-line-interface\n[Node.js API]: /docs/usage.md#nodejs-api\n[Configuring Depcop]: /docs/configuration.md\n\n[eslint-plugin-node]: https://github.com/mysticatea/eslint-plugin-node\n[dependency-check]: https://github.com/maxogden/dependency-check\n[require-lint]: https://github.com/TabDigital/require-lint\n\n[CoffeeScript]: http://coffeescript.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryym%2Fnode-depcop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryym%2Fnode-depcop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryym%2Fnode-depcop/lists"}