https://github.com/mkdoc/mkcli-runtime
Runtime plugins for command line interfaces
https://github.com/mkdoc/mkcli-runtime
Last synced: about 1 year ago
JSON representation
Runtime plugins for command line interfaces
- Host: GitHub
- URL: https://github.com/mkdoc/mkcli-runtime
- Owner: mkdoc
- License: other
- Archived: true
- Created: 2016-08-03T06:52:44.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-03T07:17:11.000Z (almost 10 years ago)
- Last Synced: 2025-04-19T12:48:27.459Z (about 1 year ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Runtime Plugins
[](https://travis-ci.org/mkdoc/mkcli-runtime)
[](https://npmjs.org/package/mkcli-runtime)
[](https://coveralls.io/github/mkdoc/mkcli-runtime?branch=master)
> 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`).
---
- [Install](#install)
- [API](#api)
- [load](#load)
- [run](#run)
- [License](#license)
---
## API
### load
```javascript
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
```javascript
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](https://github.com/mkdoc/mkdoc) on August 3, 2016
[mkdoc]: https://github.com/mkdoc/mkdoc
[mkcli]: https://github.com/mkdoc/mkcli
[through]: https://github.com/tmpfs/through3
[commonmark]: http://commonmark.org
[jshint]: http://jshint.com
[jscs]: http://jscs.info