mkcli-runtime

Runtime plugins for command line interfaces

Usage no npm install needed!

<script type="module">
  import mkcliRuntime from 'https://cdn.skypack.dev/mkcli-runtime';
</script>

README

Runtime Plugins

Build Status npm version Coverage Status

Runtime plugins for command line interfaces

Collection of plugins for command line interfaces defined using the [mkcli][] tool.

Install

npm i mkcli-runtime --save

For the command line interface install mkdoc globally (npm i -g mkdoc).



API

load

load(def[, opts])

Load a program definition into a new program assigning the definition properties to the program.

Properties are passed by reference so if you modify the definition the program is also modified.

Returns a new program.

  • def Object the program definition.
  • opts Object program options.

run

run(src, argv[, runtime], cb)

Load a program definition into a new program assigning the definition properties to the program.

Properties are passed by reference so if you modify the definition the program is also modified.

The callback function signature is function(err, req) where req is a request object that contains state information for program execution.

Plugins may decorate the request object with pertinent information that does not affect the target object that receives the parsed arguments.

Returns a new program.

  • src Object the source program or definition.
  • argv Array the program arguments.
  • runtime Object runtime configuration.
  • cb Function callback function.

License

MIT


Created by mkdoc on August 3, 2016