This code (directly taken from the docs):
const dirIter = await tjs.readdir('.');
for await (const item of dirIter) {
console.log(item.name);
}
If run as a script will work just fine.
If run in the repl tjs is not happy of the for await:
SyntaxError: Unexpected identifier 'await'
at <evalScript>:1:1
at evalScript (native)
at doEval (:0:0)
at eval_and_print (:0:0)
at handle_cmd (:0:0)
at readline_handle_cmd (:0:0)
at handle_key (:0:0)
at handle_char (:0:0)
at handle_byte (:0:0)
at term_read_handler (:0:0)
>