Skip to content

Commit e1dca4d

Browse files
committed
update/rebuild docs
1 parent 918723a commit e1dca4d

File tree

2 files changed

+86
-132
lines changed

2 files changed

+86
-132
lines changed

.verb.md

+42-65
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> {%= description %}
44
5-
**BREAKING CHANGES in 2.0**
5+
**Changes from v1.0.0 to v{%= version %}**
66

77
- all path-related properties are now on the `path` object
88
- all boolean properties are now on the `is` object
@@ -21,82 +21,59 @@ See the tests for [hundreds of examples](./test.js).
2121

2222
```js
2323
var parseGlob = require('{%= name %}');
24-
parseGlob('a/b/{c,d}/*.js');
2524
```
2625

27-
**Returns:**
26+
**Example**
2827

2928
```js
30-
{ path:
31-
{ dirname: 'a/b/{c,d}/',
32-
filename: '*.js',
33-
basename: '*',
34-
extname: '.js',
35-
ext: 'js' },
36-
is: { glob: true, braces: true, negated: false, globstar: false,
37-
dotfile: false, dotdir: false },
38-
original: 'a/b/{c,d}/*.js',
39-
pattern: 'a/b/{c,d}/*.js' }
29+
parseGlob('a/b/c/**/*.{yml,json}');
4030
```
4131

42-
## Properties
43-
44-
The object returned by parseGlob has the following properties:
45-
46-
- `pattern`: the glob pattern
47-
- `base`: when `true` is passed as the second argument, a `base` path is extracted and stripped from `pattern`. See more [below](#base-property)
48-
- `original`: a copy of the original, unmodified glob pattern
49-
- `path`: file path segments
50-
+ `path.dirname`: directory
51-
+ `path.filename`: filename, including extension
52-
+ `path.basename`: filename, without extension
53-
+ `path.extname`: file extension, with dot
54-
+ `path.ext`: file extension, without dot
55-
- `is`: an object with boolean information about the glob:
56-
+ `is.glob`: true if the pattern actually a glob pattern
57-
+ `is.negated`: true if it's a negation pattern (`!**/foo.js`)
58-
+ `is.globstar`: true if the pattern has a double star (`**`)
59-
+ `is.dotfile`: true if the pattern should match dotfiles
60-
+ `is.dotdir`: true if the pattern should match dot-directories (like `.git`)
61-
62-
63-
### base property
64-
65-
The `base` property is created by taking any leading dirname segments in the pattern that do not contain any glob symbols (`!*{}?(|)[]`). If a base cannot be extracted, the value of `base` will be an empty string.
66-
67-
**Examples**
68-
69-
Without `base` defined:
32+
**Returns:**
7033

7134
```js
72-
var tokens = parseGlob('a/b/{c,d}/*.js');
73-
// tokens.base => 'undefined'
74-
// tokens.pattern => 'a/b/{c,d}/*.js'
35+
{ orig: 'a/b/c/**/*.{yml,json}',
36+
is:
37+
{ glob: true,
38+
negated: false,
39+
extglob: false,
40+
braces: true,
41+
brackets: false,
42+
globstar: true,
43+
dotfile: false,
44+
dotdir: false },
45+
glob: '**/*.{yml,json}',
46+
base: 'a/b/c',
47+
path:
48+
{ dirname: 'a/b/c/**/',
49+
basename: '*.{yml,json}',
50+
filename: '*',
51+
extname: '.{yml,json}',
52+
ext: '{yml,json}' } }
7553
```
7654

77-
With `base` defined:
78-
79-
```js
80-
var tokens = parseGlob('a/b/{c,d}/*.js', true);
81-
// tokens.base => 'a/b'
82-
// tokens.pattern => '{c,d}/*.js'
83-
```
55+
## Properties
8456

85-
The resulting object would be:
57+
The object returned by parseGlob has the following properties:
8658

87-
```js
88-
{ path:
89-
{ dirname: 'a/b/{c,d}/',
90-
filename: '*.js',
91-
basename: '*',
92-
extname: '.js',
93-
ext: 'js' },
94-
is: { glob: true, negated: false, globstar: false,
95-
dotfile: false, dotdir: false },
96-
original: 'a/b/{c,d}/*.js',
97-
pattern: '{c,d}/*.js',
98-
base: 'a/b' }
99-
```
59+
- `orig`: a copy of the original, unmodified glob pattern
60+
- `is`: an object with boolean information about the glob:
61+
+ `glob`: true if the pattern actually a glob pattern
62+
+ `negated`: true if it's a negation pattern (`!**/foo.js`)
63+
+ `extglob`: true if it has extglobs (`@(foo|bar)`)
64+
+ `braces`: true if it has braces (`{1..2}` or `.{txt,md}`)
65+
+ `brackets`: true if it has POSIX brackets (`[[:alpha:]]`)
66+
+ `globstar`: true if the pattern has a globstar (double star, `**`)
67+
+ `dotfile`: true if the pattern should match dotfiles
68+
+ `dotdir`: true if the pattern should match dot-directories (like `.git`)
69+
- `glob`: the glob pattern part of the string, if any
70+
- `base`: the non-glob part of the string, if any
71+
- `path`: file path segments
72+
+ `dirname`: directory
73+
+ `basename`: file name with extension
74+
+ `filename`: file name without extension
75+
+ `extname`: file extension with dot
76+
+ `ext`: file extension without dot
10077

10178
## Related
10279
{%= related(['glob-base', 'glob-parent', 'is-glob', 'glob-path-regex', 'micromatch']) %}

README.md

+44-67
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Parse a glob pattern into an object of tokens.
44
5-
**BREAKING CHANGES in 2.0**
5+
**Changes from v1.0.0 to v3.0.0**
66

77
- all path-related properties are now on the `path` object
88
- all boolean properties are now on the `is` object
@@ -25,85 +25,62 @@ See the tests for [hundreds of examples](./test.js).
2525

2626
```js
2727
var parseGlob = require('parse-glob');
28-
parseGlob('a/b/{c,d}/*.js');
2928
```
3029

31-
**Returns:**
30+
**Example**
3231

3332
```js
34-
{ path:
35-
{ dirname: 'a/b/{c,d}/',
36-
filename: '*.js',
37-
basename: '*',
38-
extname: '.js',
39-
ext: 'js' },
40-
is: { glob: true, braces: true, negated: false, globstar: false,
41-
dotfile: false, dotdir: false },
42-
original: 'a/b/{c,d}/*.js',
43-
pattern: 'a/b/{c,d}/*.js' }
33+
parseGlob('a/b/c/**/*.{yml,json}');
4434
```
4535

46-
## Properties
47-
48-
The object returned by parseGlob has the following properties:
49-
50-
- `pattern`: the glob pattern
51-
- `base`: when `true` is passed as the second argument, a `base` path is extracted and stripped from `pattern`. See more [below](#base-property)
52-
- `original`: a copy of the original, unmodified glob pattern
53-
- `path`: file path segments
54-
+ `path.dirname`: directory
55-
+ `path.filename`: filename, including extension
56-
+ `path.basename`: filename, without extension
57-
+ `path.extname`: file extension, with dot
58-
+ `path.ext`: file extension, without dot
59-
- `is`: an object with boolean information about the glob:
60-
+ `is.glob`: true if the pattern actually a glob pattern
61-
+ `is.negated`: true if it's a negation pattern (`!**/foo.js`)
62-
+ `is.globstar`: true if the pattern has a double star (`**`)
63-
+ `is.dotfile`: true if the pattern should match dotfiles
64-
+ `is.dotdir`: true if the pattern should match dot-directories (like `.git`)
65-
66-
67-
### base property
68-
69-
The `base` property is created by taking any leading dirname segments in the pattern that do not contain any glob symbols (`!*{}?(|)[]`). If a base cannot be extracted, the value of `base` will be an empty string.
70-
71-
**Examples**
72-
73-
Without `base` defined:
36+
**Returns:**
7437

7538
```js
76-
var tokens = parseGlob('a/b/{c,d}/*.js');
77-
// tokens.base => 'undefined'
78-
// tokens.pattern => 'a/b/{c,d}/*.js'
39+
{ orig: 'a/b/c/**/*.{yml,json}',
40+
is:
41+
{ glob: true,
42+
negated: false,
43+
extglob: false,
44+
braces: true,
45+
brackets: false,
46+
globstar: true,
47+
dotfile: false,
48+
dotdir: false },
49+
glob: '**/*.{yml,json}',
50+
base: 'a/b/c',
51+
path:
52+
{ dirname: 'a/b/c/**/',
53+
basename: '*.{yml,json}',
54+
filename: '*',
55+
extname: '.{yml,json}',
56+
ext: '{yml,json}' } }
7957
```
8058

81-
With `base` defined:
82-
83-
```js
84-
var tokens = parseGlob('a/b/{c,d}/*.js', true);
85-
// tokens.base => 'a/b'
86-
// tokens.pattern => '{c,d}/*.js'
87-
```
59+
## Properties
8860

89-
The resulting object would be:
61+
The object returned by parseGlob has the following properties:
9062

91-
```js
92-
{ path:
93-
{ dirname: 'a/b/{c,d}/',
94-
filename: '*.js',
95-
basename: '*',
96-
extname: '.js',
97-
ext: 'js' },
98-
is: { glob: true, negated: false, globstar: false,
99-
dotfile: false, dotdir: false },
100-
original: 'a/b/{c,d}/*.js',
101-
pattern: '{c,d}/*.js',
102-
base: 'a/b' }
103-
```
63+
- `orig`: a copy of the original, unmodified glob pattern
64+
- `is`: an object with boolean information about the glob:
65+
+ `glob`: true if the pattern actually a glob pattern
66+
+ `negated`: true if it's a negation pattern (`!**/foo.js`)
67+
+ `extglob`: true if it has extglobs (`@(foo|bar)`)
68+
+ `braces`: true if it has braces (`{1..2}` or `.{txt,md}`)
69+
+ `brackets`: true if it has POSIX brackets (`[[:alpha:]]`)
70+
+ `globstar`: true if the pattern has a globstar (double star, `**`)
71+
+ `dotfile`: true if the pattern should match dotfiles
72+
+ `dotdir`: true if the pattern should match dot-directories (like `.git`)
73+
- `glob`: the glob pattern part of the string, if any
74+
- `base`: the non-glob part of the string, if any
75+
- `path`: file path segments
76+
+ `dirname`: directory
77+
+ `basename`: file name with extension
78+
+ `filename`: file name without extension
79+
+ `extname`: file extension with dot
80+
+ `ext`: file extension without dot
10481

10582
## Related
106-
* [glob-base](https://github.com/jonschlinkert/glob-base): Split a glob into a base path and a pattern.
83+
* [glob-base](https://github.com/jonschlinkert/glob-base): Returns an object with the (non-glob) base path and the actual pattern.
10784
* [glob-parent](https://github.com/es128/glob-parent): Strips glob magic from a string to provide the parent path
10885
* [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern.
10986
* [glob-path-regex](https://github.com/regexps/glob-path-regex): Regular expression for matching the parts of glob pattern.
@@ -134,4 +111,4 @@ Released under the MIT license
134111

135112
***
136113

137-
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 06, 2015._
114+
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 08, 2015._

0 commit comments

Comments
 (0)