From 8806326a4f3823b6deb7e29b31bc0fd82057b653 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Tue, 17 Mar 2015 07:48:29 +0000 Subject: [PATCH] Docs: Added allowEmpty option for gulp.src --- docs/API.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/API.md b/docs/API.md index 6c2443e7d..1d4a903d8 100644 --- a/docs/API.md +++ b/docs/API.md @@ -101,6 +101,21 @@ Default: `false` If true, it will create a duplex stream which passes items through and emits globbed files. +### options.allowEmpty +Type: `Boolean` +Default: `false` + +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. + +```js +// Emits an error if app/scripts.js doesn't exist +gulp.src('app/scripts.js') + .pipe(...); + +// Won't emit an error +gulp.src('app/scripts.js', { allowEmpty: true }) + .pipe(...); +``` ### gulp.dest(path[, options])