Please use gulp-load-plugins instead.

Automatically load any gulp plugins in your package.json

npm install gulp-load-tasks
5 downloads in the last day
60 downloads in the last week
218 downloads in the last month


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-tasks

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 gulpLoadTasks = require("gulp-load-tasks");
var tasks = gulpLoadTasks();

Or, even shorter:

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

Will result in the following happening:

tasks.jshint = require("gulp-jshint");
tasks.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


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


  • add link to this repository into package.json (thanks @ben-eb).
  • move to gulpLoadTasks 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