Skip to content

Commit 8950c89

Browse files
authored
Docs: Bring options documentation inline with changes (#256)
1 parent d9aab22 commit 8950c89

File tree

1 file changed

+40
-30
lines changed

1 file changed

+40
-30
lines changed

README.md

+40-30
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ vfs.src(['./js/**/*.js', '!./js/vendor/*.js'])
4141
Takes a glob string or an array of glob strings as the first argument and an options object as the second.
4242
Returns a stream of [vinyl] `File` objects.
4343

44-
__Note: UTF-8 BOM will be stripped from all UTF-8 files read with `.src` unless disabled in the options.__
44+
__Note: UTF-8 BOM will be removed from all UTF-8 files read with `.src` unless disabled in the options.__
4545

4646
#### Globs
4747

@@ -62,7 +62,7 @@ fs.src(['*.js', '!b*.js'])
6262
#### Options
6363

6464
- Values passed to the options must be of the right type, otherwise they will be ignored.
65-
- All options can be passed a function instead of a value. The function must return a value of the right type, otherwise it will be ignored.
65+
- All options can be passed a function instead of a value. The function will be called with the [vinyl] `File` object as its only argument and must return a value of the right type for the option.
6666

6767
##### `options.buffer`
6868

@@ -88,17 +88,17 @@ Type: `Date` or `Number`
8888

8989
Default: `undefined`
9090

91-
##### `options.stripBOM`
91+
##### `options.removeBOM`
9292

93-
Causes the BOM to be stripped on UTF-8 encoded files. Set to `false` if you need the BOM for some reason.
93+
Causes the BOM to be removed on UTF-8 encoded files. Set to `false` if you need the BOM for some reason.
9494

9595
Type: `Boolean`
9696

9797
Default: `true`
9898

9999
##### `options.sourcemaps`
100100

101-
Enables sourcemap support on files passed through the stream. Will load inline sourcemaps and resolve sourcemap links from files. Uses [gulp-sourcemaps] under the hood.
101+
Enables sourcemap support on files passed through the stream. Will load inline sourcemaps and resolve sourcemap links from files.
102102

103103
Type: `Boolean`
104104

@@ -114,7 +114,7 @@ Default: `true`
114114

115115
##### `options.dot`
116116

117-
Whether or not you want globs to match on dot files or not (e.g. `.gitignore`)
117+
Whether or not you want globs to match on dot files or not (e.g. `.gitignore`). __Note: This option is not resolved from a function because it is passed verbatim to node-glob.__
118118

119119
Type: `Boolean`
120120

@@ -173,44 +173,47 @@ Default: The process `mode`.
173173

174174
##### `options.overwrite`
175175

176-
Whether or not existing files with the same path should be overwritten. Can also be a function that takes in a file and returns `true` or `false`.
176+
Whether or not existing files with the same path should be overwritten.
177177

178-
Type: `Boolean` or `Function`
178+
Type: `Boolean`
179179

180180
Default: `true` (always overwrite existing files)
181181

182182
##### `options.sourcemaps`
183183

184184
Enables sourcemap support on files passed through the stream. Will write inline soucemaps if specified as `true`.
185-
Specifying a `string` is shorthand for the path option. Uses [gulp-sourcemaps] under the hood.
185+
Specifying a `string` path will write external sourcemaps at the given path.
186186

187187
Examples:
188188

189189
```js
190190
// Write as inline comments
191-
vfs.dest('./', {
192-
sourcemaps: true
193-
});
191+
vfs.dest('./', { sourcemaps: true });
194192

195193
// Write as files in the same folder
196-
vfs.dest('./', {
197-
sourcemaps: '.'
198-
});
199-
200-
// Any other options are passed through to [gulp-sourcemaps]
201-
vfs.dest('./', {
202-
sourcemaps: {
203-
path: '.',
204-
addComment: false,
205-
includeContent: false
206-
}
207-
});
194+
vfs.dest('./', { sourcemaps: '.' });
208195
```
209196

210-
Type: `Boolean`, `String` or `Object`
197+
Type: `Boolean` or `String`
211198

212199
Default: `undefined` (do not write sourcemaps)
213200

201+
##### `options.relativeSymlinks`
202+
203+
When creating a symlink, whether or not the created symlink should be relative. If `false`, the symlink will be absolute. __Note: This option will be ignored if a `junction` is being created.__
204+
205+
Type: `Boolean`
206+
207+
Default: `false`
208+
209+
##### `options.useJunctions`
210+
211+
When creating a symlink, whether or not a directory symlink should be created as a `junction`.
212+
213+
Type: `Boolean`
214+
215+
Default: `true` on Windows, `false` on all other platforms
216+
214217
### `symlink(folder[, options])`
215218

216219
Takes a folder path string or a function as the first argument and an options object as the second. If given a function, it will be called with each [vinyl] `File` object and must return a folder path.
@@ -234,6 +237,14 @@ Type: `String`
234237

235238
Default: `process.cwd()`
236239

240+
##### `options.mode`
241+
242+
The mode the symlinks should be created with.
243+
244+
Type: `Number`
245+
246+
Default: The `mode` of the input file (`file.stat.mode`) if any, or the process mode if the input file has no `mode` property.
247+
237248
##### `options.dirMode`
238249

239250
The mode the directory should be created with.
@@ -244,15 +255,15 @@ Default: The process mode.
244255

245256
##### `options.overwrite`
246257

247-
Whether or not existing files with the same path should be overwritten. Can also be a function that takes in a file and returns `true` or `false`.
258+
Whether or not existing files with the same path should be overwritten.
248259

249-
Type: `Boolean` or `Function`
260+
Type: `Boolean`
250261

251262
Default: `true` (always overwrite existing files)
252263

253-
##### `options.relative`
264+
##### `options.relativeSymlinks`
254265

255-
Whether or not the symlink should be relative or absolute.
266+
Whether or not the created symlinks should be relative. If `false`, the symlink will be absolute. __Note: This option will be ignored if a `junction` is being created.__
256267

257268
Type: `Boolean`
258269

@@ -267,7 +278,6 @@ Type: `Boolean`
267278
Default: `true` on Windows, `false` on all other platforms
268279

269280
[glob-stream]: https://github.com/gulpjs/glob-stream
270-
[gulp-sourcemaps]: https://github.com/floridoo/gulp-sourcemaps
271281
[node-glob]: https://github.com/isaacs/node-glob
272282
[gaze]: https://github.com/shama/gaze
273283
[glob-watcher]: https://github.com/wearefractal/glob-watcher

0 commit comments

Comments
 (0)