New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

depcap

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depcap

Limit the number of dependencies

0.1.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

depcap

Limit the number of dependencies through linting.

Installation

Install through npm:

npm i -D depcap

Run

Somewhere in your linting process, add the command depcap.

package.json

{
  ...
  "scripts": {
    "lint": "depcap"
  }
  ...
}

Configure

By default, the limit is 10 direct dependencies, individually through dependencies, devDependencies, similar. You can configure the limit in your package.json file under the depcap property. You can read more about the dependency types at the npm docs.

Global Limit

To set the global limit, set the prop to an integer. The following update to your package.json file would set all the dependency limits to 3.

{
  ...
  "depcap": 3
  ...
}
Individual Limit

To set the individual limit, set the prop to an object. The following update to your package.json file would set dependencies to 5 and peerDependencies to 1. All other dependencies would default to 10.

{
  ...
  "depcap": {
    "dependencies": 5,
    "peerDependencies": 1
  }
  ...
}

License

MIT

Keywords

lint

FAQs

Package last updated on 30 Apr 2019

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