Node scripts and command automaton
MIT License
Kebot is a tool that will help you manage your development scripts as well as locally installed CLI.
For an introduction to our API and more read our wiki!
var kebot = require("kebot");
kebot.task({
alias:"script",
entry:"./task/script.js"
});
Type: Object
Type: String
alias
Name of the task to use by the CLI.
Type: String
alias
The path of your node script.
Type: String
command
Run any installed CLI
Type: Array
sequential
When you have option.entry
task dependencies, are executed sequentially and at the end the main task is executed.
When you not have option.entry
they are only tasks that are executed sequentially.
Type: Array
parallel
Tasks that run in sequence without dependency.
type: Boolean
local
In true
: Run a CLI from a locally installed package, just like npm scripts when to use command input. Default false
command
property.var kebot = require("kebot");
kebot.task({
alias: "list",
command: "ls -l"
});
kb list
command
property.var kebot = require("kebot");
kebot.task({
alias: "build",
command: "babel -w ./source/ -d ./lib/"
});
If you have it installed locally in your project use local
in true
, like npm scripts, using the command
property.
var kebot = require("kebot");
kebot.task({
alias: "build",
command: "babel -w ./source/ -d ./lib/",
local: true
});
kb build
script.js
, using the entry
var kebot = require("kebot");
kebot.task({
alias: "task",
entry: "./task/script.js"
});
kb task
script.js
file with dependent tasks, using the sequential
property.var kebot = require("kebot");
kebot.task({
alias: "css",
entry: "./task/css.js",
sequential: ["fonts", "svg"]
});
kebot.task({
alias: "css",
entry: "./task/fonts.js"
});
kebot.task({
alias: "css",
entry: "./task/svg.js"
});
Use the -a
flag to execute dependencies.
The order of execution is.
kb css -a
command
or entry
in parallel, using the parallel
property.var kebot = require("kebot");
kebot.task({
alias: "watch",
entry: "./task/watch.js"
});
kebot.task({
alias: "css",
entry: "./task/css.js"
});
kebot.task({
alias: "all",
parallel: ["watch", "css"]
});
kb all
--env
var kebot = require("kebot");
kebot.task({
alias: "css",
entry: "./task/css.js"
});
process.env
command:
kb mytask --param 1 --paramtwo valuetwo
kebotfile:
var kebot = require("kebot");
kebot.task({
alias: "css",
entry: "./task/args.js"
});
task args.js:
console.log('my task args');
console.log(process.env.param); // = 1
console.log(process.env.paramtwo) // = valuetwo
Use it in your script with process.env.production
which is equal to true
kb css --env production