# bump-regex

> bump RegEx with semver

Latest version **4.1.0** (published 2020-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install bump-regex
pnpm add bump-regex
yarn add bump-regex
bun add bump-regex
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2020-06-24 |
| First published | 2016-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/bump-regex) |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Steve Lacy |
| Maintainers | stevelacy |
| Keywords | bump, regex, semver |

## Links

- npm: https://www.npmjs.com/package/bump-regex
- Repository: https://github.com/stevelacy/bump-regex
- Issues: https://github.com/stevelacy/bump-regex/issues
- npm.io page: https://npm.io/package/bump-regex

## Dependencies (1)

- [semver](https://npm.io/package/semver.md) ^5.1.0

## Recent versions

- 4.1.0 (latest) — 2020-06-24
- 4.0.0 — 2018-10-16
- 3.1.1 — 2018-04-22
- 3.1.0 — 2018-02-07
- 3.0.0 — 2017-12-28
- 2.9.0 — 2017-12-15
- 2.8.0 — 2017-10-02
- 2.7.0 — 2017-02-18
- 2.6.1 — 2017-01-26
- 2.6.0 — 2017-01-26
- 2.5.2 — 2016-11-23
- 2.5.1 — 2016-10-31
- 2.5.0 — 2016-10-30
- 2.3.0 — 2016-08-12
- 2.2.0 — 2016-07-12
- … 3 more at https://npm.io/package/bump-regex/versions

## README

# bump-regex
[![Build Status](https://travis-ci.org/stevelacy/bump-regex.png?branch=master)](https://travis-ci.org/stevelacy/bump-regex)
[![NPM version](https://badge.fury.io/js/bump-regex.png)](http://badge.fury.io/js/bump-regex)

> bump regex with semver

## Information

<table>
<tr>
<td>Package</td><td>bump-regex</td>
</tr>
<tr>
<td>Description</td>
<td>bump regex with semver</td>
</tr>
<tr>
<td>Node Version</td>
<td>>= 4.0.0</td>
</tr>
</table>

## Usage

#### Install

```sh
$ npm install --save bump-regex
```

```js

var bump = require('bump-regex');

bump('version: "0.1.2"', function(err, out) {
  // => 'version: "0.1.3"'
});
```

## Options

### options.type
Semver version type to bump

    Type: `String`
    Default: `patch`
    Valid values: `major|minor|patch|prerelease`

### options.key
Set the versioning key

    Type: `String`
    Default: `version`

### options.keys
Sets multiple versioning keys.

    Type: `Array` of `String`s
    Default: null

### options.case
Set case insensitive matching

This option enables matching a specific Case Sensitive selector
```xml
<xml>
  <version>nope</version>
  <Version>1.2.3</Version>
</xml>
```

    Type: `Boolean`
    Default: `false`

### options.version
Set a specific version to bump to.

    Type: `String`
    Default: `null`

### options.preid
Set the prerelase tag to use

    Type: `String`
    Default: `null`

### options.regex
Set the version selector regex

    Type: `RegEx`

### options.keepmetadata
Keep the metadata of the old version after bumping
(exception: you are using options.version)

    Type: `Boolean`
    Default: `false`

Example:

```js
  type: 'prerelease',
  preid : 'alphaWhateverTheYWant'

 // => '0.0.2-alphaWhateverTheYWant.0'
```

## Versioning
#### Versioning Used: [Semantic](http://semver.org/)
#### String, lowercase

  - MAJOR ("major") version when you make incompatible API changes
  - MINOR ("minor") version when you add functionality in a backwards-compatible manner
  - PATCH ("patch") version when you make backwards-compatible bug fixes.
  - PRERELEASE ("prerelease") a pre-release version

#### Version example

    major: 1.0.0
    minor: 0.1.0
    patch: 0.0.2
    prerelease: 0.0.1-2


## LICENSE [MIT](LICENSE)

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