Skip to content

jimlloyd/repl-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repl-promise

Build Status

A REPL for determinisic processing of input for scripts that use promises.

This REPL implementation is modeled after Node's repl, but unlike several other NPM packages that have been published (see below) which enhance Node's repl in various ways, this implementation is a rewrite from scratch. It was implemented for three reasons:

  1. Node's repl and readline do not behave deterministically when the input is a file stream. See issue 3628, and in particular the comment just added requesting that the issue be reopened.
  2. Node's repl is unware of promises. However, this problem is easily addressed using an add-on such as repl-promised.
  3. As a learning exercise for the author to understand promises and in particular the package Q

This implementation does not use readline and does not provide any of the niceties that one usually expects in a console application for command history, command completion, etc.

Why is it useful then?

See problem #1 above. I'm still searching for a reasonable workaround.

In the meantime, I want to be able to use REPL sessions with input and output to/from file streams in unit tests. I want the output to be appear to be a transcript of a REPL session, so that unit tests result in useful examples.

REPL+Promises alternatives

I've experimented with the following npm packages, none of which currently meet my needs.

  1. https://www.npmjs.org/package/otaat-repl
  2. https://www.npmjs.org/package/repl-promised
  3. https://www.npmjs.org/package/repl.js

About

An experimental REPL implementation using Promises.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published