node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »

vinyl-transformer

vinyl-transformer

Create Transformers for Vinyl File Streams

Version Downloads Build Status ReadMe

Documentation

See the documentation for vinyl-transformer

Usage

Vinyl FS

import {src, dest} from "vinyl-fs";
import {createTransformerFn} from "vinyl-transformer";
 
let compile = createTransformerFn((file) => {
  file.contents = /* ... */;
});
 
let stream = (src("src/**/*.js")
  .pipe(compile())
  .pipe(dest("dist"))
);

Gulp

import gulp from "gulp";
import {createTransformerFn} from "vinyl-transformer";
 
let compile = createTransformerFn((file) => {
  file.contents = /* ... */;
});
 
gulp.task("compile", () => {
  return (gulp.src("src/**/*.js")
    .pipe(compile())
    .pipe(gulp.dest("dist"))
  );
});