# req-all

> Require all files in a directory

Latest version **2.0.0** (published 2018-11-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install req-all
pnpm add req-all
yarn add req-all
bun add req-all
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-11-08 |
| First published | 2016-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 137 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | require, files, modules, all, directory, dir, folder, js, paths, multiple, index |

## Links

- npm: https://www.npmjs.com/package/req-all
- Repository: https://github.com/sindresorhus/req-all
- Homepage: https://github.com/sindresorhus/req-all#readme
- Issues: https://github.com/sindresorhus/req-all/issues
- npm.io page: https://npm.io/package/req-all

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-11-08
- 1.0.0 — 2017-01-13
- 0.1.0 — 2016-07-05

## README

# req-all [![Build Status](https://travis-ci.org/sindresorhus/req-all.svg?branch=master)](https://travis-ci.org/sindresorhus/req-all)

> Require all files in a directory

*This module is intentionally simple. Not interested in more features.*


## Install

```
$ npm install --save req-all
```


## Usage

```
.
└── dir
    ├── foo-bar.js
    └── baz-faz.js
```

```js
const reqAll = require('req-all');
const modules = reqAll('dir');

console.log(modules);
//=> {fooBar: [Function], bazFaz: [Function]}
```


## API

### reqAll([directory], [options])

#### directory

Type: `string`<br>
Default: `__dirname`

Directory to require supported files in. Unless you've modified [`require.extensions`](https://nodejs.org/api/globals.html#globals_require_extensions), that means any `.js`, `.json`, `.node` files, in that order. Does not recurse. Ignores the caller file and files starting with `.` or `_`.

#### options

Type: `Object`

##### camelize

Type: `boolean`<br>
Default: `true`

Convert dash-style names (`foo-bar`) to camel-case (`fooBar`).


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)

---
_Source: https://npm.io/package/req-all · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
