dependents / node-dependency-tree

Get the dependency tree of a module
MIT License
707 stars 84 forks source link

i dont understand the directory option #95

Closed VincentJ711 closed 5 years ago

VincentJ711 commented 6 years ago

I don't see the point of the directory option. What does it even do? Can this be documented? I feel like the filename option is all the client needs to provide. For example, "give me the dependency tree starting at the given filename". Thanks.

mrjoelkemp commented 5 years ago

There might be ways of eliminating its use by inferring the root directory about the given filename. However, for accuracy, the root directory is taken in to avoid guessing what the root is based on the given file. That root is mostly just used as a naive fallback if compiler configuration wasn't supplied to explicitly declare the root.