using await on global scope without async keyword

前端 未结 5 568
猫巷女王i
猫巷女王i 2020-12-11 02:46

I am trying to do something like this on global scope in nodejs REPL. As per my understanding both the following statements are valid. see docs



        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 03:28

    since node 10, you can run node process with --experimental-repl-await to allow to level await https://nodejs.org/api/repl.html#repl_await_keyword

提交回复
热议问题