Skip to content

Commit 7e996fb

Browse files
committedMar 25, 2018
Update Readme
1 parent 7c0bdfc commit 7e996fb

File tree

1 file changed

+62
-53
lines changed

1 file changed

+62
-53
lines changed
 

‎README.md

+62-53
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# expand-brackets [![NPM version](https://img.shields.io/npm/v/expand-brackets.svg?style=flat)](https://www.npmjs.com/package/expand-brackets) [![NPM monthly downloads](https://img.shields.io/npm/dm/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![NPM total downloads](https://img.shields.io/npm/dt/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/expand-brackets.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/expand-brackets) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/expand-brackets.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/expand-brackets)
1+
# expand-brackets [![NPM version](https://img.shields.io/npm/v/expand-brackets.svg?style=flat)](https://www.npmjs.com/package/expand-brackets) [![NPM monthly downloads](https://img.shields.io/npm/dm/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![NPM total downloads](https://img.shields.io/npm/dt/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![Linux Build Status](https://img.shields.io/travis/micromatch/expand-brackets.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/expand-brackets) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/expand-brackets.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/expand-brackets)
22

33
> Expand POSIX bracket expressions (character classes) in glob patterns.
44
@@ -10,6 +10,12 @@ Install with [npm](https://www.npmjs.com/):
1010
$ npm install --save expand-brackets
1111
```
1212

13+
Install with [yarn](https://yarnpkg.com):
14+
15+
```sh
16+
$ yarn add expand-brackets
17+
```
18+
1319
## Usage
1420

1521
```js
@@ -34,7 +40,7 @@ console.log(brackets('[![:lower:]]'));
3440

3541
## API
3642

37-
### [brackets](index.js#L29)
43+
### [brackets](index.js#L28)
3844

3945
Parses the given POSIX character class `pattern` and returns a
4046
string that can be used for creating regular expressions for matching.
@@ -45,10 +51,17 @@ string that can be used for creating regular expressions for matching.
4551
* `options` **{Object}**
4652
* `returns` **{Object}**
4753

48-
### [.match](index.js#L54)
54+
### [.match](index.js#L52)
4955

5056
Takes an array of strings and a POSIX character class pattern, and returns a new array with only the strings that matched the pattern.
5157

58+
**Params**
59+
60+
* `arr` **{Array}**: Array of strings to match
61+
* `pattern` **{String}**: POSIX character class pattern(s)
62+
* `options` **{Object}**
63+
* `returns` **{Array}**
64+
5265
**Example**
5366

5467
```js
@@ -60,16 +73,16 @@ console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+'));
6073
//=> ['a', 'ab']
6174
```
6275

63-
**Params**
76+
### [.isMatch](index.js#L98)
6477

65-
* `arr` **{Array}**: Array of strings to match
66-
* `pattern` **{String}**: POSIX character class pattern(s)
67-
* `options` **{Object}**
68-
* `returns` **{Array}**
78+
Returns true if the specified `string` matches the given brackets `pattern`.
6979

70-
### [.isMatch](index.js#L100)
80+
**Params**
7181

72-
Returns true if the specified `string` matches the given brackets `pattern`.
82+
* `string` **{String}**: String to match
83+
* `pattern` **{String}**: Poxis pattern
84+
* `options` **{String}**
85+
* `returns` **{Boolean}**
7386

7487
**Example**
7588

@@ -82,17 +95,16 @@ console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]'));
8295
//=> false
8396
```
8497

98+
### [.matcher](index.js#L121)
99+
100+
Takes a POSIX character class pattern and returns a matcher function. The returned function takes the string to match as its only argument.
101+
85102
**Params**
86103

87-
* `string` **{String}**: String to match
88104
* `pattern` **{String}**: Poxis pattern
89105
* `options` **{String}**
90106
* `returns` **{Boolean}**
91107

92-
### [.matcher](index.js#L123)
93-
94-
Takes a POSIX character class pattern and returns a matcher function. The returned function takes the string to match as its only argument.
95-
96108
**Example**
97109

98110
```js
@@ -105,15 +117,15 @@ console.log(isMatch('a.A'));
105117
//=> true
106118
```
107119

108-
**Params**
120+
### [.makeRe](index.js#L143)
109121

110-
* `pattern` **{String}**: Poxis pattern
111-
* `options` **{String}**
112-
* `returns` **{Boolean}**
122+
Create a regular expression from the given `pattern`.
113123

114-
### [.makeRe](index.js#L145)
124+
**Params**
115125

116-
Create a regular expression from the given `pattern`.
126+
* `pattern` **{String}**: The pattern to convert to regex.
127+
* `options` **{Object}**
128+
* `returns` **{RegExp}**
117129

118130
**Example**
119131

@@ -124,15 +136,15 @@ console.log(re);
124136
//=> /^(?:[a-zA-Z])$/
125137
```
126138

127-
**Params**
139+
### [.create](index.js#L185)
128140

129-
* `pattern` **{String}**: The pattern to convert to regex.
130-
* `options` **{Object}**
131-
* `returns` **{RegExp}**
141+
Parses the given POSIX character class `pattern` and returns an object with the compiled `output` and optional source `map`.
132142

133-
### [.create](index.js#L187)
143+
**Params**
134144

135-
Parses the given POSIX character class `pattern` and returns an object with the compiled `output` and optional source `map`.
145+
* `pattern` **{String}**
146+
* `options` **{Object}**
147+
* `returns` **{Object}**
136148

137149
**Example**
138150

@@ -163,12 +175,6 @@ console.log(brackets('[[:alpha:]]'));
163175
// parsingErrors: [] }
164176
```
165177

166-
**Params**
167-
168-
* `pattern` **{String}**
169-
* `options` **{Object}**
170-
* `returns` **{Object}**
171-
172178
## Options
173179

174180
### options.sourcemap
@@ -227,7 +233,7 @@ In addition to performance and matching improvements, the v0.2.0 refactor adds c
227233

228234
**Added features**
229235

230-
* parser is exposed, so that expand-brackets parsers can be used by upstream parsers (like [micromatch](https://github.com/jonschlinkert/micromatch))
236+
* parser is exposed, so that expand-brackets parsers can be used by upstream parsers (like [micromatch](https://github.com/micromatch/micromatch))
231237
* compiler is exposed, so that expand-brackets compilers can be used by upstream compilers
232238
* source maps
233239

@@ -249,54 +255,57 @@ console.log(res.map);
249255

250256
### Related projects
251257

252-
* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces[more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.")
253-
* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/jonschlinkert/extglob) | [homepage](https://github.com/jonschlinkert/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.")
254-
* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.")
255-
* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/jonschlinkert/nanomatch) | [homepage](https://github.com/jonschlinkert/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)")
258+
* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support[more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.")
259+
* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.")
260+
* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.")
261+
* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)")
256262

257263
### Contributing
258264

259265
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
260266

261267
### Contributors
262268

263-
| **Commits** | **Contributor**<br/> |
264-
| --- | --- |
265-
| 66 | [jonschlinkert](https://github.com/jonschlinkert) |
266-
| 2 | [MartinKolarik](https://github.com/MartinKolarik) |
267-
| 2 | [es128](https://github.com/es128) |
268-
| 1 | [eush77](https://github.com/eush77) |
269+
| **Commits** | **Contributor** |
270+
| --- | --- |
271+
| 69 | [jonschlinkert](https://github.com/jonschlinkert) |
272+
| 3 | [danez](https://github.com/danez) |
273+
| 2 | [MartinKolarik](https://github.com/MartinKolarik) |
274+
| 2 | [es128](https://github.com/es128) |
275+
| 1 | [doowb](https://github.com/doowb) |
276+
| 1 | [eush77](https://github.com/eush77) |
277+
| 1 | [mjbvz](https://github.com/mjbvz) |
269278

270279
### Building docs
271280

272-
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
281+
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
273282

274-
To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
283+
To generate the readme, run the following command:
275284

276285
```sh
277-
$ npm install -g verb verb-generate-readme && verb
286+
$ npm install -g verbose/verb#dev verb-generate-readme && verb
278287
```
279288

280289
### Running tests
281290

282-
Install dev dependencies:
291+
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
283292

284293
```sh
285-
$ npm install -d && npm test
294+
$ npm install && npm test
286295
```
287296

288297
### Author
289298

290299
**Jon Schlinkert**
291300

292301
* [github/jonschlinkert](https://github.com/jonschlinkert)
293-
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
302+
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
294303

295304
### License
296305

297-
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
298-
Released under the [MIT license](https://github.com/jonschlinkert/expand-brackets/blob/master/LICENSE).
306+
Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).
307+
Released under the [MIT License](LICENSE).
299308

300309
***
301310

302-
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 12, 2016._
311+
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on March 25, 2018._

0 commit comments

Comments
 (0)
Please sign in to comment.