@zklogic/regenerator-runtime
v0.14.3
Published
Runtime for Regenerator-compiled generator and async functions.
Maintainers
Readme
@zklogic/regenerator-runtime
Fork notice:
@zklogic/regenerator-runtimeis a maintained, drop-in republish of theregenerator-runtimepackage (MIT, © Facebook, Inc.), kept under the@zklogicscope because the original package is no longer maintained. The runtime code is unchanged. To use it for every dependent in your tree, alias it inpackage.json:{ "overrides": { "regenerator-runtime": "npm:@zklogic/regenerator-runtime@^0.14.3" } }
What changed from regenerator-runtime, and why
Why this exists. regenerator-runtime is deprecated on npm and no longer
maintained, so security scanners (for example Sonatype Lifecycle) flag it as
end-of-life, and projects that still depend on it, directly or through
packages such as kochava or canvg, cannot upgrade to a maintained release.
This fork is a maintained copy that you can alias in place of the original
without touching your dependents.
What is different
- Package name: published as
@zklogic/regenerator-runtime. This is the only change that affects consumers, and it is why the alias above is needed. - Runtime code:
runtime.jsandpath.jsare byte-for-byte the code of upstreamregenerator-runtime, so behaviour is identical, including defining the globalregeneratorRuntime. - Package metadata:
package.jsonhas the new name, author, repository, bugs URL and aforkedFromfield that credits the original authors. - Tests: added
test/smoke.js(npm test), which checks the runtime API, a generator driven throughmark/wrap,path.jsand the global. It is not published in the package. - Publishing:
.github/workflows/publish.ymlruns the tests and publishes to npm when av*tag is pushed. - Staying current:
scripts/sync-upstream.shmerges new upstream commits into the fork and re-applies the fork metadata, so the fork keeps tracking Facebook's repository.
Everything else, including the license (MIT, © Facebook, Inc.), is unchanged. Bugs in the runtime itself belong upstream; bugs in this packaging belong in the fork's issues.
Standalone runtime for
Regenerator-compiled generator
and async functions.
To import the runtime as a module (recommended), either of the following import styles will work:
// CommonJS
const regeneratorRuntime = require("@zklogic/regenerator-runtime");
// ECMAScript 2015
import regeneratorRuntime from "@zklogic/regenerator-runtime";To ensure that regeneratorRuntime is defined globally, either of the
following styles will work:
// CommonJS
require("@zklogic/regenerator-runtime/runtime");
// ECMAScript 2015
import "@zklogic/regenerator-runtime/runtime.js";To get the absolute file system path of runtime.js, evaluate the
following expression:
require("@zklogic/regenerator-runtime/path").path