question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[async-node]: support for require flag?

See original GitHub issue

So then we can just async-node -x .mjs,.js,.jsx -r @std/esm foo.mjs

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jdaltoncommented, Feb 15, 2018

@leebyron

The @std/esm loader now works with @babel/register, nyc, and other tools that transform source.

Have you seen pirates? It’s what @babel/register uses to register its hooks. If you use that it would work seamlessly with things like @std/esm esp if you allowed the -r flagged code to run before your hook.

1reaction
leebyroncommented, Feb 15, 2018

I believe @std/esm attempts to transform sources live, so I would recommend first transforming your source files with async-to-gen to replace async/await statements, then used the output of that alongside @std/esm. Otherwise, the intermediate state of a half-transformed file will not behave as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top-level await is available in Node.js modules - Stefan Judis
Use the input-type flag to specify that the passed string value is an ECMAscript module.
Read more >
Using async/await in node 7.4 - Stack Overflow
Yes async-await is supported in Node.js v7 but its locked behind the harmony flag. Features which are not yet production ready are behind ......
Read more >
Async Await in Node.js - How to Master it? - Blog - RisingStack
Learn how to use async await in Node.js (async functions) to simplify your callback or Promise based application.
Read more >
Command-line API | Node.js v19.3.0 Documentation
The program was started with a command-line flag that forces the entry point to be loaded ... (Requires Node.js to be built against...
Read more >
Node 7.6 Brings Default Async/Await Support - InfoQ
Node.js 7.6 has shipped with official support for async/await enabled by default and better performance on low-memory devices.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found