# semantic-release-npm-deprecate

> Semantic Release NPM Deprecate Plugin

Latest version **1.0.34** (published 2022-11-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install semantic-release-npm-deprecate
pnpm add semantic-release-npm-deprecate
yarn add semantic-release-npm-deprecate
bun add semantic-release-npm-deprecate
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.34 |
| Published | 2022-11-14 |
| First published | 2021-10-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 36.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Justin Poehnelt |
| Maintainers | google-wombot |
| Keywords | semantic-release, semantic-release-plugin, deprecate, npm |

## Links

- npm: https://www.npmjs.com/package/semantic-release-npm-deprecate
- Repository: https://github.com/jpoehnelt/semantic-release-npm-deprecate
- Homepage: https://github.com/jpoehnelt/semantic-release-npm-deprecate#readme
- Issues: https://github.com/jpoehnelt/semantic-release-npm-deprecate/issues
- npm.io page: https://npm.io/package/semantic-release-npm-deprecate

## Dependencies (3)

- [tempy](https://npm.io/package/tempy.md) <2.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [@semantic-release/npm](https://npm.io/package/@semantic-release/npm.md) ^9.0.0

## Recent versions

- 1.0.34 (latest) — 2022-11-14
- 1.0.33 — 2022-10-31
- 1.0.32 — 2022-10-17
- 1.0.31 — 2022-10-04
- 1.0.30 — 2022-09-20
- 1.0.29 — 2022-09-05
- 1.0.28 — 2022-08-19
- 1.0.27 — 2022-08-05
- 1.0.26 — 2022-07-25
- 1.0.25 — 2022-07-11
- 1.0.24 — 2022-06-25
- 1.0.23 — 2022-06-10
- 1.0.22 — 2022-05-30
- 1.0.21 — 2022-05-13
- 1.0.20 — 2022-04-18
- … 20 more at https://npm.io/package/semantic-release-npm-deprecate/versions

## README

# Semantic Release NPM Deprecate Plugin

[![npm](https://img.shields.io/npm/v/semantic-release-npm-deprecate)](https://www.npmjs.com/package/semantic-release-npm-deprecate)
![Build](https://github.com/jpoehnelt/semantic-release-npm-deprecate/workflows/Build/badge.svg)
![Release](https://github.com/jpoehnelt/semantic-release-npm-deprecate/workflows/Release/badge.svg)
[![codecov](https://codecov.io/gh/jpoehnelt/semantic-release-npm-deprecate/branch/master/graph/badge.svg)](https://codecov.io/gh/jpoehnelt/semantic-release-npm-deprecate)
![GitHub contributors](https://img.shields.io/github/contributors/jpoehnelt/semantic-release-npm-deprecate?color=green)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

The `semantic-release-npm-deprecate` plugin provides functionality to mark NPM releases as deprecated.

Read more about [Semantic Release](https://semantic-release.gitbook.io/).

## Install

```bash
$ npm install -D semantic-release-npm-deprecate
```

## Basic Usage

The following example will mark all previous major versions as deprecated. That is, if the next release is `2.3.4`, all versions `< 2` will be marked as deprecated.

```json
{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/npm",
    [
      "semantic-release-npm-deprecate",
      {
        "deprecations": [
          {
            "version": "< ${nextRelease.version.split('.')[0]}",
            "message": "Please use ^${nextRelease.version.split('.')[0]}.0.0."
          }
        ]
      }
    ]
  ]
}
```

This plugin runs in the `publish` lifecycle.

## Configuration Options

- `deprecations`: An array containing objects with the following properties:
  - `version`: A version range that will be deprecated.
  - `message`: A message that will be added to the release notes.

This plugin will also check for configuration in the `package.json` file under the `deprecations` field. This is experimental and the field name may change in the future.

### NPM
Configuration for NPM registry, token, etc matches that of [@semantic-release/npm](https://www.npmjs.com/package/@semantic-release/npm).

### Templates

The `version` and `message` fields support Lodash templates and are passed the [Context](https://semantic-release.gitbook.io/semantic-release/developer-guide/plugin#context) object. The following example uses the `nextRelease` object to get the next release version and split off the major version.

```js
{
  version: "< ${nextRelease.version.split('.')[0]}";
}
```

See https://semver.npmjs.com/ for all supported version ranges.

---
_Source: https://npm.io/package/semantic-release-npm-deprecate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
