Automatically load any gulp plugins in your package.json

npm install gulp-load-plugins
271 downloads in the last day
1 422 downloads in the last week
5 360 downloads in the last month


Formally known as gulp-load-tasks, but renamed to be clearer.

Loads in any gulp plugins and attaches them to the global scope, or an object of your choice.

Build Status


$ npm install --save-dev gulp-load-plugins

Given a package.json file that has some dependencies within:

    "dependencies": {
        "gulp-jshint": "*",
        "gulp-concat": "*"

Adding this into your Gulpfile.js:

var gulp = require("gulp");
var gulpLoadPlugins = require("gulp-load-plugins");
var plugins = gulpLoadPlugins();

Or, even shorter:

var plugins = require("gulp-load-plugins")();

Will result in the following happening (roughly, plugins are lazy loaded but in practice you won't notice any difference):

plugins.jshint = require("gulp-jshint");
plugins.concat = require("gulp-concat");

You can then use the plugins just like you would if you'd manually required them, but referring to them as, rather than just name().

This frees you up from having to manually require each gulp plugin.


You can pass in an argument, an object of options (the shown options are the defaults):

    pattern: "gulp-*", // the glob to search for
    config: "package.json", // where to find the plugins
    scope: ["dependencies", "devDependencies", "peerDependencies"], // which keys in the config to look within
    replaceString: "gulp-", // what to remove from the name of the module when adding it to the context
    camelize: true, // if true, transforms hyphenated plugins names to camel case
    lazy: true, // whether the plugins should be lazy loaded on demand

Lazy Loading

In 0.4.0 and prior, lazy loading used to only work with plugins that return a function. In newer versions though, lazy loading should work for any plugin. If you have a problem related to this please try disabling lazy loading and see if that fixes it. Feel free to open an issue on this repo too.


Credit largely goes to @sindresorhus for his load-grunt-plugins plugin. This plugin is almost identical, just tweaked slightly to work with Gulp and to expose the required plugins.


  • improved lazy loading so it should work with plugins that don't just return a function. Thanks to @nfroidure for help with this.
  • plugins are lazy loaded for performance benefit. Thanks @julien-f for this.
  • turn the camelize option on by default
  • added camelize option, thanks @kombucha.
  • renamed to gulp-load-plugins.
  • add link to this repository into package.json (thanks @ben-eb).
  • move to gulpLoadplugins returning an object with the tasks define.
  • added replaceString option to configure exactly what gets replace when the plugin adds the module to the context
  • fixed keyword typo so plugin appears in search for gulp plugins
  • removed accidental console.log I'd left in
  • fixed accidentally missing a dependency out of package.json
  • initial release
npm loves you