Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-submodule

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-submodule

Import gulp tasks from sub-modules

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
Maintainers
1
Weekly downloads
 
Created
Source

gulp-submodule

Load gulp tasks from submodules to their own namespace.

Installation

$ npm install gulp-submodule

Usage

Let's say we have a super project that contains multiple submodules. And we want to run submodule gulp tasks from super projects gulp file.

Example mod/gulpfile.js

var gulp = require('gulp');

gulp.task('build', function() {
    console.log('building mod');
});

gulp.task('watch', ['build'], function() {
    console.log('watching mod');
});

module.exports = "for giggles!";

Example gulpfile.js

var gulp = require('gulp');
require('gulp-submodule')(gulp);

var mod = gulp.submodule('mod');
console.log('Mod returns ' + mod);

gulp.task('build', ['mod:build'], function() {
    console.log('building super');
});
gulp.task('watch', ['mod:watch'], function() {

});

Methods

submodule(gulp[, separator])

  • gulp gulp object
  • separator separator string (default :)

gulp.submodule(module[, options])

  • module submodule name
  • options options object
    • package | pkg dependency string (ie. 'submodule/gulpfile.js')
    • filepath path to gulp file or directory containing gulpfile.js

If options is omitted then module name is used as the modules directory.

Defining package is same as require(package).

filepath can be a submodule directory or full path to the gulpfile. If filepath points to a directory, then gulpfile.js in that directory is loaded.

If both package and filepath is defined then package is used.

Returns anything that submodule exports.

License

The MIT License (MIT)

Copyright (c) 2015 Harri Kovalainen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Package last updated on 14 Mar 2016

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