This package has been deprecated

Author message:

This module is no longer maintained. If you're interested in taking over maintenance of this repo, please contact the author

each-module

2.0.0 • Public • Published

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.

Major Version Last Minor Release Node.js Versions Support End Date
❤️ 2 N/A 4+ N/A
⌛️ 1 1.2 0.10–6 2018-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

Readme

Keywords

Package Sidebar

Install

npm i each-module

Weekly Downloads

1,465

Version

2.0.0

License

MIT

Last publish

Collaborators

  • rowanmanning