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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gasket/plugin-dynamic-plugins

v7.3.4

Published

Gasket plugin for dynamically adding plugins to Gasket

Downloads

623

Readme

@gasket/plugin-dynamic-plugins

Gasket plugin for dynamically adding plugins to Gasket

Installation

npm i @gasket/plugin-dynamic-plugins

Update your gasket file plugin configuration:

// gasket.js

+ import pluginDynamicPlugins from '@gasket/plugin-dynamic-plugins';

 export default makeGasket({
  plugins: [
+   pluginDynamicPlugins
  ]
});

Usage

This plugin gives you the option to dynamically add plugins to Gasket after the core Gasket instance has been created.

This can be useful when you want to add plugins to Gasket for specific environments or commands.

For example, if you have plugins that are really only needed for development, such as (@gasket/plugin-docs, @gasket/plugin-docusarus), you can dynamically load them into Gasket only when doing development locally through with plugin.

You could then add plugins designated only for development to you devDependencies in your package.json file.

Configuration

To specify which plugins to load dynamically, in your gasket set the dynamicPlugins prop to an array of strings containing the plugin names you want to add.

// gasket.js

export default makeGasket({
+  dynamicPlugins: [
+    '@gasket/plugin-foo', 
+    '@gasket/plugin-bar',
+    './custom-plugin.js'
+ ]
});

Conditional configuration

You can use sub-configurations by environments or commands to determine which plugins to load dynamically.

For example, if you wanted to load docs-related plugins only when using the docs commands, with a package script like:

  "docs": "node gasket.js docs"

In your gasket file, you would then configure the plugins to load dynamically when the docs command is used.

makeGasket({
  // ...
  commands: {
    'docs': {
      dynamicPlugins: [
        '@gasket/plugin-docs',
        '@gasket/plugin-docusaurus',
        '@gasket/plugin-metadata'
      ]
    }
  }
})

Waiting for dynamic plugins

Basic gasket configuration is synchronous, but dynamic plugins will be loaded asynchronously.

If you want to wait until dynamic plugins have been loaded into the Gasket instance before running app code or actions, you can do so by checking if the isReady property on the Gasket instance has been resolved.

export default {
  name: 'example-plugin',
  actions: {
    async myAction(gasket) {
+      await gasket.isReady;
      // do something async after dynamic plugins have been loaded
    }
  }
};

How it works

This plugin hooks the prepare lifecycle to add dynamic plugins to the Gasket instance.

In the prepare hook, plugins specified in the dynamicPlugins configuration are registered with the Gasket instance. The init, configure, and prepare lifecycles are then executed exclusively for the newly added dynamic plugins.

License

MIT