Desired Behavior
Allow complete control over the creation of a new REPL in code, including the ability to inject a new custom context.
Is this request related to a problem?
There are many instances where one may want to extend the behavior of ts-node by creating their own REPL that wraps it and injects a custom context. One such case is creating a REPL for a framework such as AdonisJS, which is what I'm trying to do. The problem currently is, as far as I can tell, there is no way to inject a custom context outside of using the --require flag, but that just requires a file.
It would be nice to, in my own code, be able to do something like this:
import{REPL,Context}from'ts-node'constmyContext=newContext({myGlobal: require('./some-file')})constrepl=newREPL(myContext)repl.run()Alternatives you've considered
Forking and modifying ts-node or a similar project to fit my needs.
Desired Behavior
Allow complete control over the creation of a new REPL in code, including the ability to inject a new custom context.
Is this request related to a problem?
There are many instances where one may want to extend the behavior of ts-node by creating their own REPL that wraps it and injects a custom context. One such case is creating a REPL for a framework such as AdonisJS, which is what I'm trying to do. The problem currently is, as far as I can tell, there is no way to inject a custom context outside of using the
--requireflag, but that just requires a file.It would be nice to, in my own code, be able to do something like this:
Alternatives you've considered
Forking and modifying ts-node or a similar project to fit my needs.