# reqall

> require multiple files in node

Latest version **0.0.1** (published 2013-11-07) · 0 weekly downloads

## Install

```sh
npm install reqall
pnpm add reqall
yarn add reqall
bun add reqall
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2013-11-07 |
| First published | 2013-11-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Greenier |
| Maintainers | b3ngr33ni3r |
| Keywords | require, multiple, files |

## Links

- npm: https://www.npmjs.com/package/reqall
- Repository: https://github.com/b3ngr33ni3r/reqall
- Issues: https://github.com/b3ngr33ni3r/reqall/issues
- npm.io page: https://npm.io/package/reqall

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2013-11-07

## README

reqall
======

require multiple files in node

## How?

```
var modules = require('reqall')()
```

will load __all__ the `.js` files in the directory into an object. If we had
4 javascript files in the directory, named 'one.js','two.js',etc our object
would look like this: 

```
{
  one: function,
  two: function,
  three: function,
  four: function
}
```

assuming that all the modules (one.js,etc) are written such that `exports = function(){};`
there's no magic there, all we do is call `require` on each one of the js modules in the
directory and create an object of the results.

You can also specify module names, and only those modules will be loaded. This uses
`require` syntax, so if you want to `reqall` some specific files in the same directory
you'd need to call `reqall('./file','./file2')`. 

```
var modules = require('reqall')('request','./mylib','flatiron')
```

would work just fine, assuming you've got `request` and `flatiron` installed
from npm. 

```
{
  request: function,
  mylib: valueOrWhatever,
  flatiron: object
}
```

## Caveats

you can't access the calling script via the returned object. ie, if i call `reqall` from
a script `index.js` then there will be no `index` property in the object. this is a node
limitation (well technically this could work in node sometimes, but I've disabled it for sure),
but also why would you ever want to do that.


## Moar

[MIT LICENSE](https://github.com/b3ngr33ni3r/reqall/blob/master/LICENSE)  
Follow me on twitter - [@b3ngr33ni3r](https://twitter.com/b3ngr33ni3r)  
  
Post questions/comments/bugs [here](https://github.com/b3ngr33ni3r/reqall/issues)

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