# promirepl

> Promise infused REPL

Latest version **2.0.1** (published 2019-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install promirepl
pnpm add promirepl
yarn add promirepl
bun add promirepl
```

Provides the command `prominode`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-03-02 |
| First published | 2014-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^8 |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David M. Lee, II |
| Maintainers | leedm777 |
| Keywords | repl, promises |

## Links

- npm: https://www.npmjs.com/package/promirepl
- Repository: https://github.com/building5/node-promirepl
- Homepage: https://github.com/building5/node-promirepl#readme
- Issues: https://github.com/building5/node-promirepl/issues
- npm.io page: https://npm.io/package/promirepl

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2019-03-02
- 2.0.0 — 2019-03-02
- 1.0.1 — 2014-11-15

## README

# promirepl

A promise infused REPL.

Promirepl provides a Node.js REPL which will automagically unwrap [promise][]
values. It also is Node module, with a function that can add these magical
promise inspecting capabilities to your own custom REPLs.

This allows you to use promise based APIs from the REPL just as easily as old
fashioned synchronous APIs, without a lot of messing around with callbacks and
`console.log` to get at asynchronous values from the REPL.

## Installation

Promirepl can be installed with `npm install -g promirepl`. This installs the
`prominode` executable, which starts a Node.js REPL that has magical promise
unwraping capabilities.

## Usage

    $ prominode

Whenever a value evaluates to a promise (well, technically a [thenable][]),
promirepl will wait for the promise to resolve.

    > Promise.resolve('hello')
    'hello'

    > new Promise((resolve) => {
    ... setTimeout(() => { resolve('some time later'); }, 3000);
    ... })
    'some time later'

If the promise is rejected, it will evaluate as a thrown error.

    > Promise.reject(new Error('boom'))
    Error: boom
        at repl:1:16
        at REPLServer.defaultEval (repl.js:135:27)

If you would like to stop waiting on a promise, hit escape.

    > new Promise(function () {})
    Hit escape to stop waiting on promise
    break.

If you would like to disable promise unwrapping, enter the `.promise` command.

    > .promise
    Promise auto-eval disabled

    > Promise.resolve('hello')
    {}

    > Promise.reject(new Error('boom'))
    {}

## Programmatic Usage

If you would like to use promirepl within your own custom REPL, use the
exported `promirepl` function.

    const customRepl = createCustomRepl();
    const { promirepl } = require('promirepl');
    promirepl(customRepl.start({}));

 [promise]: https://promisesaplus.com/
 [thenable]: https://promisesaplus.com/#point-7

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