vinyl-transformer
v0.3.0
Published
Create Transformers for Vinyl File Streams
Downloads
490
Maintainers
Readme
vinyl-transformer
Create Transformers for Vinyl File Streams
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"))
);
});