Replies: 1 comment 3 replies
-
Hmm, does our API expose these things? I think the experimental top level
await is an option somewhere. The tricky thing about top level await, is
that it makes all execution possibly async. Last I checked, node's own
REPL API does not expose this functionality.
Just a couple guesses to get you started. If you feel like any of this
should become a feature request, and you feel confident describing it
clearly enough for someone to implement, then feel free to open an issue.
…On Tue, Aug 9, 2022, 7:43 AM Tom Locke ***@***.***> wrote:
If I start up a repl just with ts-node, I get top-level await support by
default.
I'm trying to enable the same in a custom repl script but can't figure it
out. Any advice?
Script:
import * as tsnode from 'ts-node'
const tsrepl = tsnode.createRepl()const service = tsnode.register({
...tsrepl.evalAwarePartialHost,
transpileOnly: true,})tsrepl.setService(service)
tsrepl.start()
Also is there a way to create bindings in the repl? Like node's repl.context.foo
= 123
Thanks!
—
Reply to this email directly, view it on GitHub
<#1860>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OAPYJCPUJZ62M7TWIDVYI775ANCNFSM56APEHTQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If I start up a repl just with
ts-node
, I get top-level await support by default.I'm trying to enable the same in a custom repl script but can't figure it out. Any advice?
Script:
Also is there a way to create bindings in the repl? Like node's
repl.context.foo = 123
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions