Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

require everything in a directory

tree: 9ca6330877

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.md

node-directory

require all files and directories inside a directory

Example

As an example, this may be your index.js file in a directory

require('directory')(function (module, name) {
  exports[name] = module
})

Or require a different directory

require('directory')(__dirname + '/plugins/', function (module, name) {
  exports[name] = module
})

Installation

npm install directory

Usage

require('directory')([dirname,] iterator)

MIT License

Something went wrong with that request. Please try again.