Socket
Socket
Sign inDemoInstall

gulp-autoload-tasks

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-autoload-tasks

Auto loads gulp tasks for large modular projects


Version published
Weekly downloads
17
decreased by-22.73%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-autoload-tasks

Auto loads tasks for large modular projects, including configuration object and reducing code (imports) duplication Loading code inspired by generator-gulp-angular 's gulpefile.js

Installation

$ npm install --save-dev gulp-autoload-tasks

Usage

gulpfile.js:

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

var config = {
    src: 'src',
    tmp: '.tmp',
    dist: 'dist'
}

require('gulp-autoload-tasks')(gulp, plugins, config);

gulp.task('default', ['copy']);

gulp_tasks/copy.js:

module.exports = function (gulp, plugins, config) {

gulp.task('copy', function () {
    return gulp
      .src( config.src + 'index.html' )
      .pipe( gulp.dest( config.dist ) );
})

Different Directory

gulpfile.js:

var differentDir = 'gulp_awesome_tasks'; // Default: 'gulp_tasks'

require('gulp-autoload-tasks')(gulp, plugins, config, differentDir);

API

var autoLoadTasks = require('gulp-autoload-tasks');

autoLoadTasks(gulp, plugins, config, gulpTasksDir)

Loads every file in the gulpTasksDir (gulp_tasks by default) with the following params - gulp, plugins, config. So that your module declaration looks like

gulpfile.js:

var autoLoadTasks = require('gulp-autoload-tasks');

autoLoadTasks(gulp, plugins, config, gulpTaskDir);

some_gulp_task.js:

module.exports = function (gulp, plugins, config) {
    /* code goes here */
}
gulp

Type: Object
The imported gulp module

plugins

Type: Object
Usually created by gulp-load-plugins

config

Type: Object

Configuration object. Can contain folder names and paths, generic error handler and all of the repeating variables you might have in your gulp workflow.

gulpTasksDir

Type: String
Default: gulp_tasks

The directory containing the gulp task files. Each file has the name of the task it holds - clean.js, build.js, etc...

License

Copyright (c) 2015 Shai Reznik

Licensed under the MIT License.

Keywords

FAQs

Package last updated on 10 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc