vinyl-io

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i vinyl-io

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • geekjuice