npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

regenerator-loader

v3.1.0

Published

Regenerator loader for Webpack

Downloads

8,944

Readme

Regenerator Loader for Webpack

This is a simple loader that lets you use Facebook's Regenerator with Webpack, so that you can use Co or other generator-based libraries in the browser.

To use it, install it in your project's local node_modules, then simply add regenerator! to the start of the require() string for any module that uses generators. Or, to avoid cluttering up your code with prefixes, use Webpack's standard configuration methods to specify regenerator as a preloader, postloader, or normal loader for whatever modules you want.

The simplest method of all, however, is just to specify it as a post-loader for your entire project, since modules without generator functions will not be affected. regenerator-loader uses a simple regular expression test to bypass such modules, so no time is wasted parsing or compiling them.)

(Note: because Regenerator itself does not yet officially support source maps, no source map will exist for modules containing async or generator functions. Source maps are passed through unchanged for other modules, though, so you can still use regenerator-loader as a project-wide post-loader.)

The Regenerator Runtime

To save space, only one copy of the Regenerator runtime is included in your project by default. Instead of including the runtime in each module, a require() statement is added to the beginning of those modules that actually include generator functions, to ensure that the runtime will be initialized before any generator functions are defined or used.

What's New in 3.0

Due to changes in Regenerator, regenerator-loader 3.0 now requires the regenerator-runtime package to operate without deprecation warnings. Generated modules will now require('regenerator-runtime/runtime') instead of requiring regenerator/runtime.

What's New In 2.0

Due to changes in Regenerator, regenerator-loader 2.0 no longer distinguishes between a development and minimized Regenerator runtime (since Regenerator doesn't any more, either).

(This change is considered breaking because if you were previously relying on the distinction between runtimes, or for whatever reason are expecting the generated requires to still reference regenerator/runtime/min, you'll need to change your build setup. If you have no idea what I'm talking about, then you aren't relying on it and you can just go ahead and upgrade.)

The only other change is that now regenerator-loader implements its own, slightly more strict check for whether a module contains generator or async functions, as the current version of Regenerator has occasional false positives. A module will only be processed by Regenerator if it contains a function * or async function somewhere, even if it's in a comment. (And the resulting processed code will only be used if the generated code references the Regenerator runtime; otherwise, the unprocessed original source is used.)