2.0.0 • Published 8 years ago

each-module v2.0.0

Weekly downloads
329
License
MIT
Repository
github
Last release
8 years ago

EachModule

Execute a function on each module in a directory.

NPM version Node.js version support Build status Code coverage Dependencies MIT licensed

eachModule('./examples', function (name, mod, file) {
    // name = the name of the loaded module
    // mod  = the module's exports
    // file = the absolute path of the loaded module
});

Table of Contents

Requirements

EachModule requires the following to run:

Usage

Install EachModule with npm:

npm install each-module

Use EachModule like this:

// Load EachModule
var eachModule = require('each-module');

// Find/load all JavaScript/CoffeeScript modules
// in the `examples` folder
eachModule('./examples', function (name, mod, file) {
    // This function is run for each module:
    // name = the name of the loaded module
    // mod  = the module's exports
    // file = the absolute path of the loaded module
});

Note: EachModule loads modules synchronously only, so it's best used in your application's startup – it's blocking.

Contributing

To contribute to EachModule, clone this repo locally and commit your code on a separate branch. Please write unit tests for your code, and run the linter before opening a pull-request:

make test    # run all tests
make verify  # run all linters

Support and Migration

EachModule major versions are normally supported for 6 months after their last minor release. This means that patch-level changes will be added and bugs will be fixed. The table below outlines the end-of-support dates for major versions, and the last minor release for that version.

We also maintain a migration guide to help you migrate.

:grey_question:Major VersionLast Minor ReleaseNode.js VersionsSupport End Date
:heart:2N/A4+N/A
:hourglass:11.20.10–62018-07-08

If you're opening issues related to these, please mention the version that the issue relates to.

License

EachModule is licensed under the MIT license. Copyright © 2014–2017, Rowan Manning

2.0.0

8 years ago

1.2.5

9 years ago

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

11 years ago

1.0.0

12 years ago