goatslacker / gulp-vm

Run scripts in gulp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gulp-vm

For whenever you need to run a script as part of your build process

Lets say you want to run a script, call a function which produces some output and then save that output to a file:

var streamify = require('streamify')
var vm = require('gulp-vm')

return gulp.src('./myScript.js')
  .pipe(streamify(vm(function (x) {
    return x.myMethodThatProducesOutput()
  })))
  .pipe(gulp.dest('./build/'))

gulp-vm takes a callback, but it's optional and if none is provided it just runs the script and returns the original file input as output.

License

MIT

About

Run scripts in gulp

License:MIT License


Languages

Language:JavaScript 100.0%