vinyl-read
Create vinyl files from glob patterns
Install
$ npm install --save vinyl-read
Usage
const vinylRead = ; ; const files = vinylRead;console;//=> '1' console;//=> '/Users/samverschueren/dev/vinyl-read/test.js'
API
vinylRead(patterns, [options])
Returns a promise for an array of vinyl files.
vinylRead.sync(patterns, [options])
Create an array of vinyl files synchronously and return them.
patterns
Type: string
, array
See supported minimatch
patterns.
options
base
Type: string
Default: process.cwd()
Override the base
of the vinyl file.
cwd
Type: string
Default: process.cwd()
Override the cwd
(current working directory) of the vinyl file.
buffer
Type: boolean
Default: true
Setting this to false
will return file.contents
as a stream. This is useful when working with large files. Note: Plugins might not implement support for streams.
read
Type: boolean
Default: true
Setting this to false
will return file.contents
as null and not read the file at all.
Related
- vinyl-file - Create a vinyl file from an actual file
License
MIT © Sam Verschueren