Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

What is regenerator-runtime npm package used for?

Writer Emily Wong

I've noticed it in my company's codebase and it has 30M downloads per week so I'm curious about its importance.

1 Answer

regenerator-runtime is the runtime support for compiled/transpiled async functions. (It may well have other uses, but this is the predominant one.)

When you use a compiler like Babel that compiles modern JavaScript into earlier JavaScript (a process sometimes called transpiling), one of the things you can do is compile async functions to something that will run on JavaScript engines that don't support async functions (such as the increasingly-irrelevant IE11). Babel does the syntax transformation, but the resulting code relies on runtime support from regenerator-runtime.

6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy