Socket
Socket
Sign inDemoInstall

gulp-lazy-task

Package Overview
Dependencies
69
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-lazy-task

gulp-lazy-task - lazy gulp task loader


Version published
Weekly downloads
2
decreased by-86.67%
Maintainers
1
Install size
968 kB
Created
Weekly downloads
 

Readme

Source

gulp-lazy-task - lazy gulp task loader

  1. place your tasks in external files
  2. write in gulpfile just paths and configurations
  3. you task will be required only when task will be started
  4. load gulp plugins in you task just by getter: this.util or this.sourceMaps no more require.
  5. automatic add gulp-plumber in pipe (error no more crash node)

Usage in gulpfile.js

var task = require('gulp-lazy-task')('./tasks');

task('ololo', {param:11})

in file './tasks/' + taskName + '.js'

module.exports = function (options, callback) {
  options // {param: 11}
  this.gulp // gulp
  this.util // gulp-util plugin
  this // gulp-load-plugins

  // his read you package.json file and create getters on "this"
  // you no longer need to call require()
  // to load gulp plugin like "gulp-source-maps" just white this.sourceMaps
  // and anjoy =)
}

example:

in gulpfile.js :

var task = require('gulp-lazy-task')('./tasks');

task('babel', {
  src:['./src/**/*.js'],
  dest: './build/'
})

in './tasks/babel.js' :

module.exports = function (options) {
  return this.gulp.src(options.src)
  .pipe(this.babel())
  .pipe(this.gulp.dest(options.dest))
}

in package.json :

{
  "dependencies": {
    "gulp-babel": "*"
  }
}

P.S. to support coffee-script tasks just use or gulpfile.coffee, or in head of gulpfile.js write require('coffee-script/register')

enjoy ;)

FAQs

Last updated on 17 May 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc