gloup
Another mini task runner based on bach
Deprecated
This project is no longer maintained.
Features
- One task = one file = one function
- Task on the command line are executed in series
- Compose task in parallel or in series (based on bach)
- Supports node's (or iojs) flags on the command line
This tool as been drafted for some specific needs: use it if you like, enhance it if you don't. Else gulp is a better fit for you.
Installation
npm install --save gloup
Usage
With the folder structure below:
├─ myapp└─ tasks ├─ bundle.js ├─ clean.js ├─ dev.js ├─ dist.js ├─ statics.js └─ serve.js
myapp:
The executable main script (chmod +x myapp
)
#!/usr/bin/env nodevar gloup =
tasks/clean.js: A task must export a function that return anything async-done supports (stream, promise, etc.)
var del = var resolve = resolve module { return }
tasks/dist.js: You can compose tasks using tasks name (based on filename) or function
var series = var parallel = moduleexports =
Now, myapp
can be used as a task runner
> myapp clean bundle serve gloup ⇢ clean +0ms gloup ⇠ clean +0ms gloup ⇢ bundle +1s gloup ⇠ bundle +6s gloup ⇢ serve +0ms gloup ⇠ serve +2ms
Start a composed task
> myapp dist gloup ⇢ clean +0ms gloup ⇠ clean +0ms gloup ⇢ bundle +1s gloup ⇢ statics +1s gloup ⇠ bundle +6s gloup ⇠ statics +6s gloup ⇢ serve +0ms gloup ⇠ serve +2ms
With node options:
> myapp --debug --es_staging serveDebugger listening on port 5858 gloup ⇢ serve +0ms gloup ⇠ serve +2ms
Quiet mode (remove gloup messages):
> myapp serve --quiet
api
Create a command line tool
#!/usr/bin/env nodevar gloup = // Path to the tasks folder // Force node (iojs) flags
Use series
and parallel
composer (just a convenient wrapper around bach) to compose tasks with name.
// gloup.series(taskFolder) -> {function} :var series = // gloup.parallel(taskFolder) -> {function} :var parallel = moduleexports =