aseemk / requireDir

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

Add is_directory identifier #38

Closed mmbfreitas closed 6 years ago

mmbfreitas commented 8 years ago

Hi,

i am add is_directory attr when the item represent a directory node.

Tks

aseemk commented 7 years ago

Hi there,

I'm sorry I haven't been timely in responding to these issues and PRs.

If you're interested in taking over the maintainer role for this project, please let me know.

More details: https://github.com/aseemk/requireDir/pull/31#issuecomment-255744987

Cheers, Aseem

stephenlacy commented 7 years ago

@mmbfreitas Thanks for the commit, one thing to note is adding the is_directory key will add that key to the resulting object. For instance, the output of ./simple becomes:

{
  a: 'a',
  b: 'b',
  is_directory: true
}

Also, I think it would be better for the key to be isDirectory to match node's stats api.

yocontra commented 6 years ago

Hi - new maintainer here. I don't think this is a feature we'll add, the solution of tacking on additional attributes will have unintended consequences. You should be able to solve this problem with the new mapKey/mapValue/filter functions.