vinyl-io
v1.0.0
Published
Map of file source to destination
Downloads
1
Readme
vinyl-io
Get source and destination paths of a vinyl stream
Useful when you want need the source and destination of files in a stream
Install
$ npm install --save vinyl-io
Usage
import vfs from 'vinyl-fs';
import vio from 'vinyl-io';
vfs.src('src/**/*.js')
.pipe(vio('dest', {src, dest} => {
console.log(`Copying ${src} -> ${dest}`);
}))
.pipe(vfs.dest('dest'));
// If you need the entire array of source and destinations
const stream = vio('dest');
vfs.src('src/**/*.js')
.pipe(stream)
.pipe(vfs.dest('dest'))
.on('end', () => {
stream.io.forEach(({src, dest}) => {
console.log(`Copied ${src} to ${dest}`);
});
});
License
MIT © Nicholas Hwang