1.0.3 • Published 9 years ago

reqdirp v1.0.3

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

reqdirp

Recursively requires files in a specified directory

API

reqdirp(dir ,exts, exports)

Returns and object containing all module.exports from .js/.json files within a directory and its subdirectories

var reqdirp = require('reqdirp')
  , modules = reqdirp('./path/to/some/directory')
  
// `modules` will now be an object containing all exports from every .js and .json file
// reqdirp excludes index.js, package.json, and node_modules
  

dir

Type: String

Path of directory to be required. If not absolute, will be relative to process.cwd()

exts

Type: Array Default: ['.js','.json']

A list of files to require()

exports

Type: Object Default: {}

An object to assign all module.exports to

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago