Socket
Socket
Sign inDemoInstall

depcap

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    depcap

Limit the number of dependencies


Version published
Weekly downloads
7
Maintainers
1
Install size
12.2 MB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 30 Apr 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc