# quick-repl

> An extension of the node repl that includes history and a callback logger and utility

Latest version **0.0.1** (published 2014-07-07) · MIT license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2014-07-07 |
| First published | 2014-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James Newell |
| Maintainers | jrnewell |
| Keywords | repl, console, history, callback, utility |

## Links

- npm: https://www.npmjs.com/package/quick-repl
- Repository: https://github.com/jrnewell/quick-repl
- Issues: https://github.com/jrnewell/quick-repl/issues
- npm.io page: https://npm.io/package/quick-repl

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) *

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2014-07-07

## README

# Quick Repl

An extension of the node repl that includes automatic history loading and saving, plus a callback logger and utility.  Useful for debugging an asynchronous node server or app.

On load, it will attempt to load the history file which can be retrieved through the arrow keys.  On exit, it will automatically save the history back to the file.

Other features include the 'cb' placeholder that you can use in place of a callback (very similar to the one provided in compound.js (https://github.com/1602/compound).  It will output the values returned to it and make them available in the repl.

lodash is also automatically available in the repl as 'lo'.

## Install

```shell
npm install --save-dev quick-repl
```

## Simple Example

```javascript
var quickRepl = require('quick-repl');

quickRepl.start(function(err, context) {
  // check err

  // add custom additions from your application to the context
  context.foo = function() {
    return 1;
  }
});

```

This brings up the repl.

```javascript

// repl history is loading from ./.repl-history

>> var bar = function(cb) { cb("hello", [1, 2, 3], {}); };
undefined
>> bar(cb)
Callback called with 3 arguments:
_0 = 'hello'
_1 = [ 1, 2, 3 ]
_2 = {}

undefined
>> lo.isArray(_1)
true
>> foo()
1
>> .exit

// repl history is saved to ./.repl-history

```

### Options

Quick repl takes the following options:

```javascript

// the options defaults
var opts = {
  historyFile: "./.repl-history", // name of history file to write to and read from
  prompt: ">> ",                  // prompt to use in the repl
  maxCb: 10,                      // maxmium number of arguments 'cb' will save in _$n properties
  verbose: true,                  // use util.inspect instead of toString for cb logging
  depth: 2                        // util.inspect depth option
};

quickRepl.start(opts, function(err, context) {
  //...
});

```

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License)

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