UNPKG

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