Skip to content

botanicus/task.node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About Task.node

Task.node is a simple task manager for Node.js similar to Make, Rake, Scons or others.

Features

Each task can have dependencies which are tasks which will be executed before this task is invoked. Example: task.define("release:tag", ["release:push"])

For easier interaction with user tasks can also have a description and since task name is just a string, you can define tasks like -L or --list etc.

You can namespace your tasks by namespace:task, i. e. db:migrate. There is no additional support for namespaces, there is just convetion that namespaces are separated by a colon.

CLI Execution

The first argument is always name of the task which will be executed. If no task is specified, then task called default will be executed. Each task can have positional and named arguments.

Positional Arguments

Every arguments except the first one and arguments which start with -- are considered as positional arguments and will be used as arguments for the task.

So if we want to have something like ./taskfile.js spec spec/task then we have to define task task.define("spec", function(path) { sh("jspec " + path) } )

Named Arguments

- --no-git or --without-git {"git": false}
- --git or --with-git {"git": true}
- --path=spec/task {"path": “spec/task”}

./taskfile.js clean:whitespace lib src —indentation=" "

task.define("clean:whitespace", function(paths) {
  var indentation = this.options.indentation || "  "
  // normalize whitespace
})

./taskfile.js taskname arg1 arg2 options
function(arg1, arg2, options) {
options.path // “spec/task”
}

Built-in Tasks

Currently there are two built-in tasks: -T for list of all available tasks with its descriptions and dependencies and -H for a general help.

Examples

Take a look at examples/tasks.js

About

Task manager similar to Rake for Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published