regenerator-runtime
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Regenerator-runtime is a standalone runtime for Regenerator-compiled generator and asynchronous functions. It is a package immensely beneficial for JavaScript developers seeking to write code using modern, async functions or generators and need them to work seamlessly across all browsers.
Incorporating regenerator-runtime within your project is quite straightforward. You have two options for using it in your application depending on if you prefer ES2015 standard or CommonJS.
For CommonJS, you can import regenerator-runtime as a module using:
const regeneratorRuntime = require("regenerator-runtime");
And for ECMAScript 2015, you can import it as:
import regeneratorRuntime from "regenerator-runtime";
To make sure regeneratorRuntime
is defined on a global scale, you have an option for both styles:
For CommonJS:
require("regenerator-runtime/runtime");
For ECMAScript 2015:
import "regenerator-runtime/runtime.js";
To extract the absolute file system path of runtime.js
, you can evaluate the following expression:
require("regenerator-runtime/path").path
Unfortunately, there isn't an explicitly dedicated documentation for regenerator-runtime. Nonetheless, you can find valuable information regarding its usage and function in the Regenerator's section on GitHub at https://github.com/facebook/regenerator. This page will allow you to understand more about regenerator-runtime, including its overall function and how to efficiently use it within your projects.