vinyl-adapter-picker
Protocol based vinyl adapter picker.
vinyl-adapter-picker lets you register vinyl adapters and use them depending on the protocol part of globs.
Install
npm install --save vinyl-adapter-picker
Usage
const vp = const vfs = const vhttp = // add default adaptervp// add `http` adaptervp // push local files to remotevp
API
add(protocol, adapter)
Register an adapter for the given protocol. It will then be available via src and dest.
protocol
{string|null}
Protocol to associate the adapter with. It must be the protocol part of a standard uri
.
If null
is specified, it registers a default adapter that will be used if a glob
does not
contain any protocol part (i.e *.txt
, ./*.txt
).
adapter
{object}
Adapter that must provide src
and dest
functions.
Example
const vfs = // explicit protocolvpvp // default protocolvpvp
remove(protocol)
Remove the associated adapter.
protocol
{string|null}
Protocol for which the associated adapter is removed.
src(globs[, options])
and dest(globs[, options])
Return a stream of vinyl File objects.
globs
{string|array}
globs
that are used to create the stream. Given the protocol part of each glob
, the appropriate
adapter is used.
options
{object}
Options passed to underlying adapter.
License
MIT © Nicolas Gryman