Skip to content

Commit 8806326

Browse files
callumacraephated
authored andcommittedDec 31, 2017
Docs: Added allowEmpty option for gulp.src
1 parent 96febce commit 8806326

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎docs/API.md

+15
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,21 @@ Default: `false`
101101
If true, it will create a duplex stream which passes items through and
102102
emits globbed files.
103103

104+
### options.allowEmpty
105+
Type: `Boolean`
106+
Default: `false`
107+
108+
When true, will allow singular globs to fail to match. Otherwise, globs which are only supposed to match one file (such as `./foo/bar.js`) will cause an error to be thrown if they don't match.
109+
110+
```js
111+
// Emits an error if app/scripts.js doesn't exist
112+
gulp.src('app/scripts.js')
113+
.pipe(...);
114+
115+
// Won't emit an error
116+
gulp.src('app/scripts.js', { allowEmpty: true })
117+
.pipe(...);
118+
```
104119

105120
### gulp.dest(path[, options])
106121

0 commit comments

Comments
 (0)
Please sign in to comment.