<commit_before># Reqr

Tiny configurable library for requiring collections of files.



## Reqr.dir(path, config)

`require`s a collection of files in a directory.

Returns a tree object: each leaf is a loaded file, each node is a directory.


### The defaults

The following is an example with the default configuration.

```js
Reqr.dir('.', {
  recur: false,
  filter: /\.js$/,
  alias: Reqr.replace(/\.js$/, ''),
  aliasDir: function (a) { return a; },
  cull: true,
  lazy: false,
  transform: function (a) { return a; },
  choose: function (a, b) { return a; }
})
```


### Config
<commit_msg>Added contents to readme<commit_after># Reqr

Tiny configurable library for requiring collections of files.


# Contents

* [Reqr.dir](#reqrdirpath-config)
* [Reqr.scan](#reqrscanpath-config)
* [Reqr.load](#reqrloadtree-config)
* [Reqr.force](#reqrforcetree)
* [Reqr.replace](#reqrreplacepattern-replacementstring)


## Reqr.dir(path, config)

`require`s a collection of files in a directory.

Returns a tree object: each leaf is a loaded file, each node is a directory.


### The defaults

The following is an example with the default configuration.

```js
Reqr.dir('.', {
  recur: false,
  filter: /\.js$/,
  alias: Reqr.replace(/\.js$/, ''),
  aliasDir: function (a) { return a; },
  cull: true,
  lazy: false,
  transform: function (a) { return a; },
  choose: function (a, b) { return a; }
})
```


### Config

{'fraction_non_alphanumeric': 0.15003538570417552, 'fraction_numerical': 0.0, 'mean_word_length': 3.859106529209622, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1387877', 'n_tokens_mistral': 501, 'n_tokens_neox': 481, 'n_words': 159}