<commit_before># 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_

```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_

```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[, gulpfile])
 - `module` submodule name
 - `gulpfile` path to submodules gulpfile

If optional `gulpfile` is omitted then module name is used as the modules directory.

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

Returns anything that submodule exports.

## License

The MIT License (MIT)

Copyright (c) 2015 <NAME>

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<commit_msg>Update README.md to reflect api changes<commit_after># 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_

```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_

```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 <NAME>

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
{'fraction_non_alphanumeric': 0.13255360623781676, 'fraction_numerical': 0.002227791701475912, 'mean_word_length': 4.719745222929936, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1609160', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1080, 'n_words': 405}