gobblejs / gobble

The last build tool you'll ever need
333 stars 20 forks source link

Question: Asynchronous File transformer? #91

Closed timshannon closed 8 years ago

timshannon commented 8 years ago

Is there anyway to do an asynchronous file transformer? I have a plugin that makes more sense as an individual file transformer instead of a directory transformer, but it returns a promise or calls a callback asynchronously when it's finished.

The definition of a file transformer appears to only allow for a synchronous return of the finished transform.

Is something like this available?

function myplugin ( input, options, callback ) {
  transformFunction(input, options, function(result) {
     callback(result);
  });
}
timshannon commented 8 years ago

112 is the same but with more info, I'm closing this one.

Thanks,