I want a ts-node repl, with all its benefits, with context from my app attached, (note I would in reality attach an imported module, but here am just attaching a variable to illustrate my need minimally.) Since I want context attached to my repl, I am using the node built-in package, repl, like so:
Search Terms
repl
repl.start()
context
double
STDIN
STDOUT
Expected Behavior
STDOUT is not double printed
Actual Behavior
STDOUT is double printed
Steps to reproduce the problem
I want a ts-node repl, with all its benefits, with context from my app attached, (note I would in reality attach an imported module, but here am just attaching a variable to illustrate my need minimally.) Since I want context attached to my repl, I am using the node built-in package,
repl
, like so:example.ts
Maybe this is not best practice, if so, please advise.
If I try to run the script
example.ts
with ts-node, then type the six characters, f,o,o,b,a,r, I see the following output:So the bug is that every input is doubled, as I would expect to only see
foobar
.Minimal reproduction
https://github.com/TypeStrong/ts-node-repros/pull/38
Specifications