gulp-natron

Use Natron in your Gulpfile

VersionVersion DownloadsDownloads

import gulp from "gulp";
import {gulpTask, defer} from "gulp-natron";

function greet(name) {
  let d = defer();
  console.log(`Hello ${name}.`);
  setTimeout(() => {
    d.resolve("Thanks for waiting. Goodbye.");
  }, 1000);
  return d.promise;
}

function message(msg) {
  console.log(msg);
}

let greetTask = gulpTask([greet, message], {
  options: {pipe: true},
});

gulp.task("greet", () => {
  return greetTask("World");
});
$ gulp greet
[11:15:00] Using gulpfile ~/gulpfile.js
[11:15:00] Starting 'greet'...
[11:15:00] Starting '<TaskSequence_0>'...
[11:15:00] Starting ':greet'...
Hello World.
[11:15:01] Finished ':greet' after 1 s
[11:15:01] Starting ':message'...
Thanks for waiting. Goodbye.
[11:15:01] Finished ':message' after 436 μs
[11:15:01] Finished '<TaskSequence_0>' after 1.01 s
[11:15:01] Finished 'greet' after 1.01 s

📘

Natron Core

This module exports task, promisify, defer, Task and TaskContext from natron-core.

📘

Natron Vinyl Utilities

This module exports merge, awaitAll and fromPromise from natron-vinyl.

📘

Vinyl Transformer

This module exports transformer and Transformer from vinyl-transformer.