# base-cli-process

> Normalizers for common argv commands handled by the base-cli plugin. Also pre-processes the given object with base-cli-schema before calling `.process()`

Latest version **0.1.19** (published 2017-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install base-cli-process
pnpm add base-cli-process
yarn add base-cli-process
bun add base-cli-process
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.19 |
| Published | 2017-03-12 |
| First published | 2016-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0 |
| Dependencies | 20 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | api, app, application, base, base-plugin, baseplugin, building-blocks, cli, command-line, commands, create, framework, plugin, plugins, process, tool, toolkit, tools |

## Links

- npm: https://www.npmjs.com/package/base-cli-process
- Repository: https://github.com/node-base/base-cli-process
- Issues: https://github.com/node-base/base-cli-process/issues
- npm.io page: https://npm.io/package/base-cli-process

## Dependencies (20)

- [debug](https://npm.io/package/debug.md) ^2.6.2
- [kind-of](https://npm.io/package/kind-of.md) ^3.1.0
- [base-cli](https://npm.io/package/base-cli.md) ^0.5.0
- [base-cwd](https://npm.io/package/base-cwd.md) ^0.3.4
- [base-pkg](https://npm.io/package/base-pkg.md) ^0.2.4
- [arr-union](https://npm.io/package/arr-union.md) ^3.1.0
- [log-utils](https://npm.io/package/log-utils.md) ^0.2.1
- [pad-right](https://npm.io/package/pad-right.md) ^0.2.2
- [lazy-cache](https://npm.io/package/lazy-cache.md) ^2.0.2
- [merge-deep](https://npm.io/package/merge-deep.md) ^3.0.0
- [mixin-deep](https://npm.io/package/mixin-deep.md) ^1.2.0
- [base-option](https://npm.io/package/base-option.md) ^0.8.4
- [object.pick](https://npm.io/package/object.pick.md) ^1.2.0
- [union-value](https://npm.io/package/union-value.md) ^1.0.0
- [export-files](https://npm.io/package/export-files.md) ^2.1.1
- [is-valid-app](https://npm.io/package/is-valid-app.md) ^0.2.1
- [fs-exists-sync](https://npm.io/package/fs-exists-sync.md) ^0.1.0
- [base-cli-schema](https://npm.io/package/base-cli-schema.md) ^0.1.19
- [arrayify-compact](https://npm.io/package/arrayify-compact.md) ^0.2.0
- [base-config-process](https://npm.io/package/base-config-process.md) ^0.1.9

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.1.19 (latest) — 2017-03-12
- 0.1.18 — 2016-07-12
- 0.1.17 — 2016-07-12
- 0.1.16 — 2016-07-11
- 0.1.15 — 2016-07-07
- 0.1.14 — 2016-07-02
- 0.1.13 — 2016-06-21
- 0.1.12 — 2016-06-09
- 0.1.11 — 2016-06-09
- 0.1.10 — 2016-05-12
- 0.1.9 — 2016-05-12
- 0.1.8 — 2016-05-09
- 0.1.7 — 2016-05-07
- 0.1.6 — 2016-05-03
- 0.1.5 — 2016-04-28
- … 5 more at https://npm.io/package/base-cli-process/versions

## README

# base-cli-process [![NPM version](https://img.shields.io/npm/v/base-cli-process.svg?style=flat)](https://www.npmjs.com/package/base-cli-process) [![NPM monthly downloads](https://img.shields.io/npm/dm/base-cli-process.svg?style=flat)](https://npmjs.org/package/base-cli-process)  [![NPM total downloads](https://img.shields.io/npm/dt/base-cli-process.svg?style=flat)](https://npmjs.org/package/base-cli-process) [![Linux Build Status](https://img.shields.io/travis/node-base/base-cli-process.svg?style=flat&label=Travis)](https://travis-ci.org/node-base/base-cli-process)

> Normalizers for common argv commands handled by the base-cli plugin. Also pre-processes the given object with base-cli-schema before calling `.process()`

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save base-cli-process
```

## Usage

Normalizes the given object with [base-cli-schema](https://github.com/jonschlinkert/base-cli-schema) before calling the `.process` method from [base-cli](https://github.com/node-base/base-cli).

```js
var Base = require('base');
var cli = require('base-cli-process');

var app = new Base();
app.use(cli());

var pkg = require('./package');

app.cli.process(pkg, function(err) {
  if (err) throw err;
});
```

## API

### [.asyncHelpers](lib/fields/asyncHelpers.js#L15)

Load and register async template helpers from a glob or filepath.

**Example**

```sh
$ app --asyncHelpers="foo.js"
```

### [.config](lib/fields/config.js#L32)

Persist a value to a namespaced config object in package.json. For example, if you're using `verb`, the value would be saved to the `verb` object.

**Params**

* **{Object}**: app

**Example**

```sh
# display the config
$ app --config
# set a boolean for the current project
$ app --config=toc
# save the cwd to use for the current project
$ app --config=cwd:foo
# save the tasks to run for the current project
$ app --config=tasks:readme
```

### [.cwd](lib/fields/cwd.js#L17)

Set the `--cwd` to use in the current project.

**Example**

```sh
$ app --cwd=foo
```

### [.data](lib/fields/data.js#L23)

Define data to be used for rendering templates.

**Example**

```sh
$ app --data=foo:bar
# {foo: 'bar'}

$ app --data=foo.bar:baz
# {foo: {bar: 'baz'}}

$ app --data=foo:bar,baz
# {foo: ['bar', 'baz']}}
```

### [.del](lib/fields/del.js#L20)

Delete a value from `app`.

**Example**

```json
# delete a value from package.json config (e.g. `verb` object)
$ app --del=config.foo
# delete a value from in-memory options
$ app --del=option.foo
# delete a property from the global config store
$ app --del=globals.foo
```

### [.dest](lib/fields/dest.js#L17)

Set a `dest` path on `app.options`.

**Example**

```sh
$ app --dest=foo
```

### [.enable](lib/fields/enable.js#L14)

Enable a configuration setting. Also pass `-c` to save the value to the `verb.config` object in package.json.

**Example**

```sh
$ app --enable toc
```

### [.engines](lib/fields/engine.js#L12)

Alias for [engines](#engines)

### [.engines](lib/fields/engines.js#L15)

Load engines from a filepath or glob pattern.

**Example**

```sh
$ app --engines="./foo.js"
```

### [.get](lib/fields/get.js#L16)

Get a value from `app` and set it on `app.cache.get` in memory, allowing the value to be re-used by another command, like `--set`.

**Example**

```json
$ app --get=pkg.name
```

### [.help](lib/fields/help.js#L19)

Show a help menu.

**Example**

```sh
$ app --help
```

### [.helpers](lib/fields/helpers.js#L15)

Load and register async template helpers from a glob or filepath.

**Example**

```sh
$ app --helpers="foo.js"
```

### [.option](lib/fields/option.js#L15)

Set options. This is the API-equivalent of calling `app.option('foo', 'bar')`.

**Example**

```sh
$ app --option=foo:bar
```

### [.options](lib/fields/options.js#L15)

Set options. This is the API-equivalent of calling `app.option('foo', 'bar')`.

**Example**

```sh
$ app --options=foo:bar
```

### [.plugins](lib/fields/plugins.js#L15)

Load plugins from a filepath or glob pattern.

**Example**

```sh
$ app --plugins="./foo.js"
```

### [.run](lib/fields/run.js#L13)

For tasks to run, regardless of other options passed on the command line.

**Example**

```json
$ app --run
```

### [.set](lib/fields/set.js#L17)

Set the given value, or a value was previously cached by `--get`.

**Example**

```json
$ app --set=pkg.name:foo
# example: persist `pkg.name` to `store.data.name`
$ app --get=pkg.name --set=store.name
```

### [.get](lib/fields/show.js#L16)

Get a value from `app` and set it on `app.cache.get` in memory, allowing the value to be re-used by another command, like `--set`.

**Example**

```json
$ app --get=pkg.name
```

### [.toc](lib/fields/toc.js#L20)

Enable or disable Table of Contents rendering

**Example**

```sh
# enable
$ app --toc
# or
$ app --toc=true
# disable
$ app --toc=false
```

## About

### Related projects

* [base-cli](https://www.npmjs.com/package/base-cli): Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a… [more](https://github.com/node-base/base-cli) | [homepage](https://github.com/node-base/base-cli "Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a few plugins, like 'base-store', 'base-options' and 'base-data'.")
* [base-config](https://www.npmjs.com/package/base-config): base-methods plugin that adds a `config` method for mapping declarative configuration values to other 'base… [more](https://github.com/node-base/base-config) | [homepage](https://github.com/node-base/base-config "base-methods plugin that adds a `config` method for mapping declarative configuration values to other 'base' methods or custom functions.")
* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Contributors

| **Commits** | **Contributor** | 
| --- | --- |
| 72 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [slang800](https://github.com/slang800) |

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the MIT License.

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 12, 2017._

---
_Source: https://npm.io/package/base-cli-process · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
