aseemk / requireDir

Node.js helper to require() directories.
MIT License
484 stars 60 forks source link

doesn't require subdirectories #41

Closed Janpot closed 6 years ago

Janpot commented 7 years ago

currently I have the following situation:

/foo/bar.js
/foo/baz/index.js
/foo/baz/bar.js

what I'm expecting when I do

requireDir('./foo');

is

{
  bar: '...',
  baz: '...'
}

like it follows the semantics of require with respect to subfolders, but what I get is

{
  bar: '...'
}

while the recurse options is not what I want because that would give me:

{
  bar: '...',
  baz: {
    index: '...',
    bar: '...'
  }
}
yocontra commented 6 years ago

closing, duplicate of https://github.com/aseemk/requireDir/pull/23