Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require everything in a directory
JavaScript
tree: 2d50b4db87

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
Makefile
README.md
index.js
package.json

README.md

directory

Build Status

require all files and directories inside a directory synchronously

Example

Any of the below

// return an object hash
var dir = require('directory')

// or pass a callback
require('directory')(function (module, name) {
  exports[name] = module
})

// or pass a different path
var dir = require('directory')(__dirname +'/../plugins/')

// or pass both
var dir = require('directory')(__dirname +'/plugins/', function (module, name) {
  exports[name] = module
})

Installation

npm install directory

Usage

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

Tests

npm install mocha -g and make test

License

MIT

Something went wrong with that request. Please try again.