5.1.0 • Published 5 months ago

@rowanmanning/require-all v5.1.0

Weekly downloads
21
License
MIT
Repository
github
Last release
5 months ago

@rowanmanning/require-all

Require all modules in a directory recursively.

Requirements

This library requires the following to run:

Usage

Install with npm:

npm install @rowanmanning/require-all

Load the library into your code with a require call:

const { requireAll } = require('@rowanmanning/require-all');

Require all modules in a directory. Note: this loads modules synchronously, so it's best used only where blocking doesn't matter, e.g. in your application's startup process:

const modules = requireAll('./directory-path');

modules is an array of objects, each being information about the module:

{
    // The name of the file, this is relative to the given directory path
    // and does not include the file extension or a leading slash.
    name: String,

    // The full path to the module.
    fullPath: String,

    // The module file extension, including the leading period, and lower-cased
    extension: String,

    // The required module's exports
    moduleExports: Object
}

Migration

A new major version of this project is released if breaking changes are introduced. We maintain a migration guide to help users migrate between these versions.

Contributing

The contributing guide is available here. All contributors must follow this library's code of conduct.

License

Licensed under the MIT license. Copyright © 2020, Rowan Manning

5.1.0

5 months ago

5.0.0

8 months ago

4.2.2

1 year ago

4.2.1

1 year ago

4.2.0

1 year ago

4.1.0

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

6 years ago