Permalink
Browse files

updated readme

  • Loading branch information...
tblobaum committed Dec 6, 2011
1 parent 0bb20d0 commit ab7b4a29f2909e018e98824898f50dc3ac927cc2
Showing with 16 additions and 8 deletions.
  1. +16 −8 README.md
View
@@ -1,31 +1,39 @@
node-directory
=========
-A module to require all files and directories inside a directory. By
-default requires all files in the current directory except itself, and maps
+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.
Example
-------
As an example, this may be your index.js file in a directory that contains all
-of the plugins for your models. The call to directory will require all of the
-other files in the current directory and loop through them.
+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.
```javascript
-var directory = require('directory')
-
module.exports = function (models, options) {
options = options || { debug:false }
- directory(function (module) {
- models.plugin(module, options)
+ require('directory')(function (module) {
+ models.model(module.name, module, options)
})
}
````
+Require a different directory:
+
+```javascript
+
+require('directory')(__dirname + '/plugins', function (plugin) {
+ models.plugin(plugin, options)
+})
+
+````
+
Installation
------------

0 comments on commit ab7b4a2

Please sign in to comment.