# mfdc-repl

> Internal MFDC REPL CLI

Latest version **2.1.0** (published 2017-03-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install mfdc-repl
pnpm add mfdc-repl
yarn add mfdc-repl
bun add mfdc-repl
```

Provides the command `mrepl`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2017-03-15 |
| First published | 2015-11-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt Carter |
| Maintainers | hash-bang |
| Keywords | REPL, MFDC, CLI |

## Links

- npm: https://www.npmjs.com/package/mfdc-repl
- Repository: https://github.com/MomsFriendlyDevCo/mfdc-repl
- Homepage: https://github.com/MomsFriendlyDevCo/mfdc-repl#readme
- Issues: https://github.com/MomsFriendlyDevCo/mfdc-repl/issues
- npm.io page: https://npm.io/package/mfdc-repl

## Dependencies (11)

- [glob](https://npm.io/package/glob.md) ^7.1.1
- [ttys](https://npm.io/package/ttys.md) 0.0.3
- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [moment](https://npm.io/package/moment.md) ^2.17.1
- [mongoose](https://npm.io/package/mongoose.md) ~4.5.10
- [monoxide](https://npm.io/package/monoxide.md) 0.0.80
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [babel-core](https://npm.io/package/babel-core.md) ^6.24.0
- [repl.history](https://npm.io/package/repl.history.md) ^0.1.4
- [async-chainable](https://npm.io/package/async-chainable.md) ^2.3.1

## 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

- 2.1.0 (latest) — 2017-03-15
- 2.0.3 — 2016-12-08
- 2.0.2 — 2016-09-14
- 2.0.1 — 2016-08-16
- 2.0.0 — 2016-08-16
- 1.2.2 — 2016-05-13
- 1.2.1 — 2016-04-06
- 1.2.0 — 2016-04-03
- 1.1.3 — 2016-01-19
- 1.1.2 — 2015-12-03
- 1.1.1 — 2015-12-03
- 1.1.0 — 2015-11-27
- 1.0.0 — 2015-11-26

## README

MFDC-REPL
=========
[MFDC's](http://mfdc.biz) own internal REPL command line interface.

This project provides the executable `mrepl` which has the following functionality over regular REPL:

* **Babel pre-compiler** (`babel` plugin) - All code is automatically compiled via [BabelJS](http://babeljs.io) before it is run - making things like arrow functions available on older Node releases
* **Lodash** (`lodash` plugin) - lodash is provided as `lodash`, `l` and `__`
* **Moment** (`moment` plugin) - moment is provided as `moment`
* **Mongoose project support** (`mongoose` plugin) - If the files `./config/index.js`, `./config/db.js` and `./models/index.js` are found they are loaded in that order (with `./models/index.js` expected to return an object containing the available compiled schemas. Models are then provided in the `db` object. e.g. `db.users.find()` will return all users.
* **STDIN slurping** (`stdin` plugin) - Any piped input into the program is provied as the `input` variable. Automatic decoding of the variable will be attempted by `JSON.parse()` otherwise it will be a raw string.
* **History saving** - History saing is enabled by default




Installation
------------
Simply run the following:

	sudo npm install -g mfdc-repl

You should now be able to run the REPL interface with:

	mrepl


Plugins
=======
Plugins are provided in the `plugins/` folder within the main script file.

Each plugin is a simple JavaScript file which is expected to expose a function taking a callback and the main `app` argument. Each plugin can decorate the properties of the program and return the callback when finished.


Some usefully exposed properties:

| Property path        | Type    | Default         | Description                                                           |
|----------------------|---------|-----------------|-----------------------------------------------------------------------|
| `app`                | Object  | Complex         | The main application object - an instance of a `commander` definition |
| `app.verbose`        | Number  | 0               | Verbosity level                                                       |
| `app.plugin`         | Array   | `['./plugins']` | Globs to search for plugins                                           |
| `app.repl`           | Object  | Complex         | Repl options when creating the interface                              |
| `app.repl.globals`   | Object  | `{}`            | Any exported globals that should be available inside the REPL session |
| `app.repl.eval`      | Array   | `[]`            | Array of evaluation functions to run. Each Eval is run as a compose pipeline with the final output being returned to the REPL session |
| `inspect.depth`      | Number  | 2               | How deeply to examine objects when printing results to the console    |
| `inspect.colors`     | Boolean | `true`          | Whether colors are enabled when printing results to the console       |

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