string of TypeScript.
eval
implementation compatible with node's REPL API
Can be used in advanced scenarios if you want to manually create your own
node REPL instance and delegate eval to this ReplService
.
Example:
import {start} from 'repl';
const replService: tsNode.ReplService = ...; // assuming you have already created a ts-node ReplService
const nodeRepl = start({eval: replService.eval});
Bind this REPL to a ts-node compiler service. A compiler service must be bound before eval
-ing code or starting the REPL
Start a node REPL
Start a node REPL, evaling a string of TypeScript before it starts.
Generated using TypeDoc
Append code to the virtual source file, compile it to JavaScript, throw semantic errors if the typechecker is enabled,
and execute it.
Note: typically, you will want to call
start()
instead of using this method.