<commit_before># {%= name %} {%= badge("fury") %}

> {%= description %}

{%= include("install-npm", {save: true}) %}

## API

### [.exportFiles](index.js#L22)
> See [tests](./test.js) for more examples

* `dir` **{String}**: directory to read and export
* `recurse` **{Boolean}**: when `true`, read directory recursivly, default `false`
* `opts` **{Object}**: control options
  - `recurse` **{Boolean}** guess.. if defined will be overwritten
  - `text` **{Boolean}** should be `true` when you want to export other files, eg `.css`
  - `key` **{Function}** `function(fp, opts)`, where `opts` is same provided options object
  - `yaml` **{Function}** `function(fp, opts)`, where `fp` is full filepath
  - `read` **{Function}** `function(fp, opts)`, default is `fs.readFileSync`
  - `stat` **{Function}** `function(fp, opts)`, custom stat function, default is `fs.statSync`
  - `filter` **{Function}** signature `function(fp, opts)`, default filter is only for `.js` files
  - `*` **{*}**: any other options, eg `encoding` for `fs.readFileSync` or your custom `opts.read` fn
* `returns`: {Object}


## Usage
Given you have the following files:
```
lib/
  foo.js
  bar.js
  baz.js
```

Add the following to `lib/index.js`:

```js
module.exports = require('{%= name %}')(__dirname);
//=> {foo: [function], bar: [function], baz: [function]}
```
> Notice: you can control key names of the object with providing function to `opts.key`

To only return modules in the immediate directory (e.g. don't recurse):

```js
// pass `false` as second or third parameter
module.exports = require('{%= name %}')(__dirname, false, opts);
// or
module.exports = require('{%= name %}')(__dirname, opts, false);
```

## Run Tests
```bash
npm test
```

## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %})

## Author
{%= include("author") %}

## License
{%= copyright() %}
{%= license() %}

***

{%= include("footer") %}<commit_msg>clean up docs<commit_after># {%= name %} {%= badge("fury") %}

> {%= description %}

{%= include("install-npm", {save: true}) %}

## Usage

```js
module.exports = require('export-files')(__dirname);
//=> {a: [function], b: [function], c: [function]}
```

### Params

```js
module.exports = require('export-files')(dir, recurse, options);
```

* `dir` **{String}**: directory with files to export.
* `recurse` **{Boolean|Object}**: or options. When `true` reads directories recursivly. Default is `false`.
* `options` **{Object}**: Options for filtering, reading, and recursion.


## Run Tests

Install dev dependencies:

```bash
npm i -d && npm test
```

## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %})

## Author
{%= include("author") %}

## License
{%= copyright({year: 2014}) %}
{%= license() %}

***

{%= include("footer") %}
{'fraction_non_alphanumeric': 0.21054445210199862, 'fraction_numerical': 0.002067539627842867, 'mean_word_length': 4.714566929133858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7398987', 'n_tokens_mistral': 1016, 'n_tokens_neox': 936, 'n_words': 309}