Comparing version 1.0.2 to 1.1.2
@@ -6,4 +6,5 @@ 'use strict'; | ||
module.exports = _.safeMerge(require('./tmp'), { | ||
requireDir: require('./require-dir'), | ||
readJson: require('./read-json'), | ||
writeJson: require('./write-json') | ||
}); |
{ | ||
"name": "ls-fs", | ||
"version": "1.0.2", | ||
"version": "1.1.2", | ||
"description": "Some file utilities", | ||
@@ -29,6 +29,8 @@ "main": "lib/ls-fs.js", | ||
"dependencies": { | ||
"callsite": "^1.0.0", | ||
"ls-lodash": "^1.0.0", | ||
"q": "^1.1.2", | ||
"q-io": "^1.11.6", | ||
"tmp": "0.0.24" | ||
"tmp": "0.0.24", | ||
"underscore.string": "^2.4.0" | ||
}, | ||
@@ -35,0 +37,0 @@ "repository": { |
@@ -59,1 +59,35 @@ # ls-fs [![Build Status](https://travis-ci.org/LiveSafe/ls-fs.svg?branch=master)](https://travis-ci.org/LiveSafe/ls-fs) | ||
### requireDir | ||
Takes a path to a directory and returns an object containing all the `require`d modules in that directory. | ||
For example, if you have a directory with: | ||
``` | ||
some-module.js | ||
other-module.js | ||
static-content.json | ||
``` | ||
`requireDir` on that directory would return an object like: | ||
``` | ||
{ | ||
someModule: <module.exports of some-module.js>, | ||
... | ||
} | ||
``` | ||
###### Usage | ||
```js | ||
lsFs.requireDir(pathToDir).then(function(requiredDirObj) { | ||
// use required modules | ||
}); | ||
``` | ||
###### Arguments | ||
1. `pathToDir` _(String)_ Path to the directory you would like to recursively require | ||
9901
18
196
93
6
2
+ Addedcallsite@^1.0.0
+ Addedunderscore.string@^2.4.0
+ Addedcallsite@1.0.0(transitive)
+ Addedunderscore.string@2.4.0(transitive)