<commit_before># grunt-require-dir

Task to build a requirejs AMD module out of a directory of files.

## Getting Started
Install this grunt plugin next to your project's [grunt.js gruntfile][getting_started] with: `npm install grunt-require-dir`

Then add this line to your project's `grunt.js` gruntfile:

```javascript
grunt.loadNpmTasks('grunt-require-dir');
```

[grunt]: https://github.com/cowboy/grunt
[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md

## Documentation
_(Coming soon)_

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][grunt].

## Release History
_(Nothing yet)_

## License
Copyright (c) 2012 <NAME>  
Licensed under the MIT license.<commit_msg>updating README<commit_after># grunt-require-dir

Task to build a requirejs AMD module out of a directory of files.

## Getting Started
Install this grunt plugin next to your project's grunt.js gruntfile with: `npm install grunt-require-dir`

Then add this line to your project's `grunt.js` gruntfile:

```javascript
grunt.loadNpmTasks('grunt-require-dir');
```

[grunt]: https://github.com/cowboy/grunt
[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md

## Config

- require-dir
  - src : Your source files to include. Should all be under one common directory
  - baseDir : The local base directory prefix, removed from the source file paths (optional)
  - prefixDir : The new directory path to place in front of the source file paths (optional)
  - dest : The destination AMD file
  - plugin : The requirejs plugin to prefix the files with (optional). Useful for templates.

```javascript
'require-dir' : {
  all : {
    plugin    : 'tpl',
    src       : 'test/fixtures/texttree/**/*.tmpl',
    baseDir   : 'test/fixtures/texttree/',
    prefixDir : 'customDir/',
    dest      : 'test/fixtures/texttree.js'
  }
},
```

## Example output

Given the config above, and the file tree below

```
|_ /fixtures
| |_ /texttree
| | |_ /A
| | | |_ one.tmpl
| | | |_ two.tmpl
| | |_ bar.tmpl
| | |_ foo.tmpl
| | |_ unwanted.ext
```

Running `grunt require-dir` (or `grunt require-dir:all`), you will
get a file in `test/fixtures/texttree.js` with the contents

```javascript
define(function(require){
  return {
  'A' : {
    'one' : require("tpl!customDir/A/one.tmpl"),
    'two' : require("tpl!customDir/A/two.tmpl")
  },
  'bar' : require("tpl!customDir/bar.tmpl"),
  'foo' : require("tpl!customDir/foo.tmpl")
  };
});
```


## Release History

0.3.0 First public release

## License
Copyright (c) 2012 <NAME>  
Licensed under the MIT license.
{'fraction_non_alphanumeric': 0.12894930198383542, 'fraction_numerical': 0.004041146216017634, 'mean_word_length': 3.941923774954628, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '6658557', 'n_tokens_mistral': 922, 'n_tokens_neox': 891, 'n_words': 277}