Keep dependencies as low as possible.
Warns or fails on new dependencies in package.json
.
npm install --save-dev danger-plugin-node-dependencies
// dangerfile.ts
import { warnDependencies, failDependencies } from 'danger-plugin-node-dependencies'
// Warn of all dependencies added since the last commit
warnDependencies()
// Warn on new dev dependencies, fail on new dependencies
warnDependencies({ devDependencies: true })
failDependencies({ dependencies: true })
danger-plugin-node-dependencies
exports two functions:
warnDependencies(options)
failDependencies(options)
The functions produce identical messages notifying you of dependencies added to package.json
, but the former produces only warning messages, while the latter causes Danger to fail when added dependencies are found.
The options are passed in the form
{
dependencies: boolean,
devDependencies: boolean
}
If a key is omitted, it defaults to false
. Passing no options will result in notification of all new dependencies.
This project was created by Levi Bostian and Oliver Emery.
Dependency size badges in ouput messages are provided by Package Phobia.