1.0.1 • Published 9 months ago

@es-pkg/gulp v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

@es-pkg/gulp

gulp node执行

NPM Version  NPM Version  unpacked size  Author

📦 Installation

npm install @es-pkg/gulp

🏠 Exports

参数类型
🐕GulpClasses
☀️defaultVariables
🎗️lastRunFunctions
🎗️parallelFunctions
🎗️registryFunctions
🎗️seriesFunctions
🎗️taskFunctions
🎗️treeFunctions

🐕Classes

Gulp

参数类型说明默认值
__constructor* new Gulp(): Gulp
Gulp: undefined | typeof Gulp
dest: ((folder:string | ((file:File) => string), opt?:DestOptions) => __global.NodeJS.ReadWriteStream) = vfs.destvfs.dest
src: ((globs:string | string[], opt?:SrcOptions) => __global.NodeJS.ReadWriteStream) = vfs.srcvfs.src
symlink: ((folder:string | ((File:File) => string), opts?:{}) => __global.NodeJS.ReadWriteStream) = vfs.symlinkvfs.symlink
watch* watch(globs:GulpClient.Globs, fn?:Undertaker.TaskFunction): "fs".FSWatcher
  • watch(globs:GulpClient.Globs, opts?:GulpClient.WatchOptions, fn?:Undertaker.TaskFunction): "fs".FSWatcher|||

☀️Variables

Const gulp

: Gulp = ...

🎗️Functions

lastRun

  • Takes a string or function (task) and returns a timestamp of the last time the task was run successfully. The time will be the time the task started. Returns undefined if the task has not been run.

  • lastRun(task:Undertaker.Task, timeResolution?:number): number

parallel

  • Takes a variable amount of strings (taskName) and/or functions (fn) and returns a function of the composed tasks or functions. Any taskNames are retrieved from the registry using the get method. When the returned function is executed, the tasks or functions will be executed in parallel, all being executed at the same time. If an error occurs, all execution will complete.

  • parallel(...tasks:Undertaker.Task[]): Undertaker.TaskFunction

  • Takes a variable amount of strings (taskName) and/or functions (fn) and returns a function of the composed tasks or functions. Any taskNames are retrieved from the registry using the get method. When the returned function is executed, the tasks or functions will be executed in parallel, all being executed at the same time. If an error occurs, all execution will complete.

  • parallel(tasks:Undertaker.Task[]): Undertaker.TaskFunction

registry

  • Returns the current registry object.

  • registry(): UndertakerRegistry

  • The tasks from the current registry will be transferred to it and the current registry will be replaced with the new registry.

  • registry(registry:UndertakerRegistry): void

series

  • Takes a variable amount of strings (taskName) and/or functions (fn) and returns a function of the composed tasks or functions. Any taskNames are retrieved from the registry using the get method. When the returned function is executed, the tasks or functions will be executed in series, each waiting for the prior to finish. If an error occurs, execution will stop.

  • series(...tasks:Undertaker.Task[]): Undertaker.TaskFunction

  • Takes a variable amount of strings (taskName) and/or functions (fn) and returns a function of the composed tasks or functions. Any taskNames are retrieved from the registry using the get method. When the returned function is executed, the tasks or functions will be executed in series, each waiting for the prior to finish. If an error occurs, execution will stop.

  • series(tasks:Undertaker.Task[]): Undertaker.TaskFunction

task

  • Returns the wrapped registered function.

  • task(taskName:string): undefined | Undertaker.TaskFunctionWrapped

  • Register the task by the taskName.

  • task(taskName:string, fn:Undertaker.TaskFunction): void

  • Register the task by the name property of the function.

  • task(fn:Undertaker.TaskFunction): void

tree

  • Optionally takes an object (options) and returns an object representing the tree of registered tasks.

  • tree(options?:Undertaker.TreeOptions): Undertaker.TreeResult