3.0.1 • Published 5 years ago

@phylum/gulp-task v3.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Gulp Task

Coverage Status Build Status Version License

Allows embedding gulp tasks as pipeline tasks.

Installation

npm i @phylum/gulp-task gulp

Usage

This package exposes a function for wrapping a gulp task into a pipeline task.

const wrap = require('@phylum/gulp-task')

const task = wrap(fn[, options])

async function example(ctx) {
	await ctx.use(task)
}
  • fn <function> | <string> - The gulp task function or the name of a registered gulp task.
  • options <object> - Optional. An object with options explained below.
  • returns <function> - The pipeline task.

options.context

The task context can be accessed from within the gulp task using the context option.

const task = wrap((done, ctx) => {
	// Gulp task code...
}, {context: true})