# danger-plugin-node-dependencies

> Keep dependencies as low as possible.

Latest version **0.0.2** (published 2019-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install danger-plugin-node-dependencies
pnpm add danger-plugin-node-dependencies
yarn add danger-plugin-node-dependencies
bun add danger-plugin-node-dependencies
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-10-09 |
| First published | 2019-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 0 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | thrymgjol |
| Maintainers | foundersclubsoftware |
| Keywords | danger, danger-plugin, dependencies |

## Links

- npm: https://www.npmjs.com/package/danger-plugin-node-dependencies
- Repository: https://github.com/foundersclubsoftware/danger-dependencies
- Homepage: https://github.com/foundersclubsoftware/danger-dependencies#readme
- Issues: https://github.com/foundersclubsoftware/danger-dependencies/issues
- npm.io page: https://npm.io/package/danger-plugin-node-dependencies

## Recent versions

- 0.0.2 (latest) — 2019-10-09

## README

# danger-plugin-node-dependencies

> Keep dependencies as low as possible.

Warns or fails on new dependencies in `package.json`.

## Usage

#### Install
```
npm install --save-dev danger-plugin-node-dependencies
```

#### At a glance
```ts
// 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 })
```

#### Sample output

---
##### Added dependencies:
 * dotenv [![install size](https://packagephobia.now.sh/badge?p=dotenv)](https://packagephobia.now.sh/result?p=dotenv)
 * helmet [![install size](https://packagephobia.now.sh/badge?p=helmet)](https://packagephobia.now.sh/result?p=helmet)
##### Added dev dependencies:
 * @types/dotenv [![install size](https://packagephobia.now.sh/badge?p=@types/dotenv)](https://packagephobia.now.sh/result?p=@types/dotenv)
 * @types/helmet [![install size](https://packagephobia.now.sh/badge?p=@types/helmet)](https://packagephobia.now.sh/result?p=@types/helmet)
 * eslint [![install size](https://packagephobia.now.sh/badge?p=eslint)](https://packagephobia.now.sh/result?p=eslint)
---

## API

`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
```ts
{
    dependencies: boolean,
    devDependencies: boolean
}
```
If a key is omitted, it defaults to `false`. Passing no options will result in notification of all new dependencies.

## Credits
This project was created by [Levi Bostian](https://curiosityio.com/) and [Oliver Emery](https://github.com/thrymgjol).

Dependency size badges in ouput messages are provided by [Package Phobia](https://packagephobia.now.sh/).

---
_Source: https://npm.io/package/danger-plugin-node-dependencies · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
