(require("shell"))()
- Description:
Shell command interface for
bkshRun
bksh -helpto see all registered shell commands.Special command-lone arguments for shell commands:
-noexit- keep the shell running after executing the command-exit- exit with error if no shell command found-exit-timeout MS- will be set to ms to wait before exit for async actions to finish-shell-delay MS- will wait before running the command to allow initialization complete
Type Definitions
shellCommand(options) → {string}
- Description:
Shell functions must be defined in
shell.commandsobject, wheremyCommandis the command name in camel case for-my-command
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object |
Returns:
| Type | Description |
|---|---|
| string |
all other values will result in returning from the run assuming the command will decide what to do, exit or continue running, no REPL is created |
Example
const { shell } = require("backendjs");
shell.commands.myCommand = function(options) {
console.log("hello");
return "continue"
}
// Calling `bksh -my-command` it will run this command.