You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
758 B

4 years ago
  1. # regenerator-runtime
  2. Standalone runtime for
  3. [Regenerator](https://github.com/facebook/regenerator)-compiled generator
  4. and `async` functions.
  5. To import the runtime as a module (recommended), either of the following
  6. import styles will work:
  7. ```js
  8. // CommonJS
  9. const regeneratorRuntime = require("regenerator-runtime");
  10. // ECMAScript 2015
  11. import regeneratorRuntime from "regenerator-runtime";
  12. ```
  13. To ensure that `regeneratorRuntime` is defined globally, either of the
  14. following styles will work:
  15. ```js
  16. // CommonJS
  17. require("regenerator-runtime/runtime");
  18. // ECMAScript 2015
  19. import "regenerator-runtime/runtime";
  20. ```
  21. To get the absolute file system path of `runtime.js`, evaluate the
  22. following expression:
  23. ```js
  24. require("regenerator-runtime/path").path
  25. ```