Skip to content

Commit

Permalink
docs: add notes about escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert authored and phated committed Jan 27, 2021
1 parent 6462360 commit d38acd4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Usage
npm install glob-parent --save
```

**Examples**

```js
var globParent = require('glob-parent');

Expand All @@ -31,7 +33,22 @@ globParent('path/**/*'); // 'path'
globParent('path/foo/bar.js'); // 'path/foo'
globParent('path/foo/'); // 'path/foo'
globParent('path/foo'); // 'path' (see issue #3 for details)
```

## Escaping

The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters:

- `?` (question mark)
- `*` (star)
- `[` (opening bracket)
- `]` (closing bracket)

**Example**

```js
globParent('foo/[bar]/') // 'foo'
globParent('foo/\\[bar]/') // 'foo/\\[bar]'
```

Change Log
Expand Down

0 comments on commit d38acd4

Please sign in to comment.