UNPKG

1.97 kBMarkdownView Raw
1# bump-regex
2[![Build Status](https://travis-ci.org/stevelacy/bump-regex.png?branch=master)](https://travis-ci.org/stevelacy/bump-regex)
3[![NPM version](https://badge.fury.io/js/bump-regex.png)](http://badge.fury.io/js/bump-regex)
4
5> bump regex with semver
6
7## Information
8
9<table>
10<tr>
11<td>Package</td><td>bump-regex</td>
12</tr>
13<tr>
14<td>Description</td>
15<td>bump regex with semver</td>
16</tr>
17<tr>
18<td>Node Version</td>
19<td>>= 0.9</td>
20</tr>
21</table>
22
23## Usage
24
25#### Install
26
27```sh
28$ npm install --save bump-regex
29```
30
31```js
32
33var bump = require('bump-regex');
34
35bump('version: "0.1.2"', function(err, out) {
36 // => 'version: "0.1.3"'
37});
38```
39
40## Options
41
42### options.type
43Semver version type to bump
44
45 Type: `String`
46 Default: `patch`
47 Valid values: `major|minor|patch|prerelease`
48
49### options.key
50Set the versioning key
51
52 Type: `String`
53 Default: `version`
54
55### options.case
56Set case insensitive matching
57
58This option enables matching a specific Case Sensitive selector
59```xml
60<xml>
61 <version>nope</version>
62 <Version>1.2.3</Version>
63</xml>
64```
65
66 Type: `Boolean`
67 Default: `false`
68
69### options.version
70Set a specific version to bump to.
71
72 Type: `String`
73 Default: `null`
74
75### options.preid
76Set the prerelase tag to use
77
78 Type: `String`
79 Default: `null`
80
81### options.regex
82Set the version selector regex
83
84 Type: `RegEx`
85
86Example:
87
88```js
89 type: 'prerelease',
90 preid : 'alphaWhateverTheYWant'
91
92 // => '0.0.2-alphaWhateverTheYWant.0'
93```
94
95## Versioning
96#### Versioning Used: [Semantic](http://semver.org/)
97#### String, lowercase
98
99 - MAJOR ("major") version when you make incompatible API changes
100 - MINOR ("minor") version when you add functionality in a backwards-compatible manner
101 - PATCH ("patch") version when you make backwards-compatible bug fixes.
102 - PRERELEASE ("prerelease") a pre-release version
103
104#### Version example
105
106 major: 1.0.0
107 minor: 0.1.0
108 patch: 0.0.2
109 prerelease: 0.0.1-2
110
111
112## LICENSE [MIT](LICENSE)