lib/gulp-import-tasks.js
function importTasks(options) {
  const opts = parseOptions(options);
  const cwd = process.cwd();
  const dir = path.join(cwd, opts.dir);

  debug(`importing tasks from "${dir}"...`);

  // This synchronously reads the contents within the chosen directory then
  // loops through each item, verifies that it is in fact a file of the correct
  // file type, then creates the tasks object and registers it with gulp.
  fs.readdirSync(dir).forEach(
    handleFile(dir, opts)
  );

  debug(`finished importing tasks`);
}
function importTasks(options) {
  const opts = parseOptions(options);
  const cwd = process.cwd();
  const dir = path.join(cwd, opts.dir);

  debug(`importing tasks from "${dir}"...`);

  // This synchronously reads the contents within the chosen directory then
  // loops through each item, verifies that it is in fact a file of the correct
  // file type, then creates the tasks object and registers it with gulp.
  fs.readdirSync(dir).forEach(
    handleFile(dir, opts)
  );

  debug(`finished importing tasks`);
}
function importTasks ( options ) { const opts = parseOptions ( options ) ; const cwd = process . cwd ( ) ; const dir = path . join ( cwd , opts . dir ) ; debug ( ` ${ dir } ` ) ; // This synchronously reads the contents within the chosen directory then // loops through each item, verifies that it is in fact a file of the correct // file type, then creates the tasks object and registers it with gulp. fs . readdirSync ( dir ) . forEach ( handleFile ( dir , opts ) ) ; debug ( ` ` ) ; }
Registers all gulp tasks within the given directory.

@param {Object|string} [options]
@param {string} [options.dir='tasks']
@param {Array.<string>} [options.extensions=['.js']]
@param {Array.<*>} [options.params=[]]
Registers all gulp tasks within the given directory .