0.2.0 • Published 10 years ago

all-in v0.2.0

Weekly downloads
12
License
-
Repository
github
Last release
10 years ago

#all-in

Short utility to require all files in a directory.

##usage

require('all-in')('[directory]', { [options] })

##options All options are optional.

####as

as: ("Object"|"Array"|"List")

Defines return type. Defaults to Object. Can also pass in Object and Array instead of their string counterparts

"Object"|Object returns an object containing a key value pair containining the filename (without the extension) and the exports of each file.

=> { file-name: ( require(file-name.ext) ) }

"Array"|Array returns an array containining the exports of each file.

=> [ require(file-name.ext) ]

"List" returns a list of files, including their extension

=> [file-name.ext]

####filetypes

filetypes: [ Array of extentions ]

Accepts an array extensions to include. Defaults to ["js"]

####run

run: "functionName"

Runs the indicated function on every module. Defaults to null

####runScope

runScope: Scope

Indicates the scope in which to call the function specified by run. Defaults to null

####runArgs

runArgs: [ Array of arguments ]

Specifies arguments to be passed to the function specified by run. Defaults to null

####hidden

hidden: (true|false)

Boolean indicating whether to include hidden files or not. Defaults to false

####index

index: (true|false)

Boolean indicating whether to include index.js or not. Defaults to false

####filter

filter: /regexp/

RegExp to indicate a pattern files must match to include. Defaults to null

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago