<commit_before>[![Build Status](https://travis-ci.org/mmorozov/dirrequire.png?branch=master)](https://travis-ci.org/mmorozov/dirrequire)
[![devDependency Status](https://david-dm.org/mmorozov/dirrequire/dev-status.png)](https://david-dm.org/mmorozov/dirrequire#info=devDependencies)
[![Code Climate](https://codeclimate.com/repos/52ca9d60e30ba067540011a3/badges/6c25cc19332b8424f7d8/gpa.png)](https://codeclimate.com/repos/52ca9d60e30ba067540011a3/feed)

[![NPM](https://nodei.co/npm/dirrequire.png?stars=true)](https://nodei.co/npm/dirrequire/)

_dirrequire_ library for async require files in directory

## Installation

    $ npm install dirrequire

## Api

### dirrequire(dirname, [include], callback)

include – array of file extensions for require

## Examples
```
routes
    auth.js
    main.js
    404.js
    config.json
```


```javascript

var dirrequire = require('dirrequire');

dirrequire(__dirname + "/routes", function(err, routes) {
    console.log(routes);
});

// {
//   '404': [Function],
//   auth: [Function],
//   config: {},
//   main: [Function]
// }
```

```javascript
var dirrequire = require('dirrequire');

dirrequire(__dirname + "/routes", ['js'], function(err, routes) {
    console.log(routes);
});

// {
//   '404': [Function],
//   auth: [Function],
//   main: [Function]
// }
```

## Running tests

```
$ npm test
```

License

The MIT License, See the included license.md file.

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mmorozov/dirrequire/trend.png)](https://bitdeli.com/free "Bitdeli Badge")<commit_msg>update read me<commit_after>[![Build Status](https://travis-ci.org/mmorozov/dirrequire.png?branch=master)](https://travis-ci.org/mmorozov/dirrequire)
[![devDependency Status](https://david-dm.org/mmorozov/dirrequire/dev-status.png)](https://david-dm.org/mmorozov/dirrequire#info=devDependencies)
[![Code Climate](https://codeclimate.com/repos/52ca9d60e30ba067540011a3/badges/6c25cc19332b8424f7d8/gpa.png)](https://codeclimate.com/repos/52ca9d60e30ba067540011a3/feed)

[![NPM](https://nodei.co/npm/dirrequire.png?stars=true)](https://nodei.co/npm/dirrequire/)

_dirrequire_ library for async require files in directory

## Installation

    $ npm install dirrequire

## Api

### dirrequire(dirname, [include], callback)

include – array of file extensions for require

## Examples
```
routes
    auth.js
    main.js
    404.js
    config.json
```


```javascript

var dirrequire = require('dirrequire');

dirrequire(__dirname + "/routes", function(err, routes) {
    console.log(routes);
});

// {
//   '404': [Function],
//   auth: [Function],
//   config: {},
//   main: [Function]
// }
```

```javascript
var dirrequire = require('dirrequire');

dirrequire(__dirname + "/routes", ['js'], function(err, routes) {
    console.log(routes);
});

// {
//   '404': [Function],
//   auth: [Function],
//   main: [Function]
// }
```

## Running tests

```
$ npm test
```

## License

The MIT License, See the included license.md file.

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mmorozov/dirrequire/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
{'fraction_non_alphanumeric': 0.18754014129736674, 'fraction_numerical': 0.03982016698779704, 'mean_word_length': 4.445804195804196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 20, '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': '3154336', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1121, 'n_words': 173}