Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tblobaum committed Jan 3, 2012
1 parent 872874d commit 06bb970
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions README.md
@@ -1,43 +1,31 @@
node-directory
=========
A simple module to require all files and directories inside a directory. By
default it requires all files in the current directory except itself, and maps
them to a callback.
# node-directory
require all files and directories inside a directory

Example
-------

As an example, this may be your index.js file in a directory that contains all
of the schemas for your models. The call to directory will require all of the
(other) files in the current directory and loop through them.
## Example
As an example, this may be your index.js file in a directory

```javascript

module.exports = function (models, options) {
options = options || { debug:false }

require('directory')(function (module, name) {
models.model(name, module, options)
})

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

````

Require a different directory:
Or require a different directory

```javascript
require('directory')(__dirname + '/plugins/', function (module, name) {
models.plugin(module, options)
exports[name] = module
})
````

Installation
------------

npm install directory --save
npm install directory

Usage
-----
Expand Down

0 comments on commit 06bb970

Please sign in to comment.