1.0.0 • Published 9 years ago

vinyl-io v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

vinyl-io Build Status

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