kevinbeaty / fs-promise

[DEPRECATED] Use mz or fs-extra^3 with Promise support
https://www.npmjs.com/package/fs-extra
MIT License
170 stars 13 forks source link

Add fs-extra as dependency #5

Closed kevinbeaty closed 8 years ago

kevinbeaty commented 8 years ago

The strategy of loading optional dependencies is non-deterministic as a fs-extra or graceful-fs library loaded in a subtree of the dependency tree may be loaded instead of the desired implementation. This could be caused by the non-deterministic loading of npm3, but there may have been cases in npm2 where this occurred as well. This is was also an issue in any-promise with a resolution discussed in kevinbeaty/any-promise#1

Options:

  1. Add fs-extra as an explicit dependency.
  2. Add graceful-fs as an explicit dependency
  3. Only use fs and remove loading of optional dependencies.

Proposal: Add fs-extra as an explicit dependency (Option 1).

jonathantneal commented 8 years ago

FWIW, I would be fine with this library evolving into an extension for fs-extra. I almost always include both.

kevinbeaty commented 8 years ago

This issue may actually be overstated since the libraries are API compatible in the order of require, i.e. if fs-extra is loaded but the user is only expecting fs, all expected functions will still work as they are passed through.

I may leave this alone until someone actually experiences an issue with the current behavior.

kevinbeaty commented 8 years ago

Reopened because @jonathantneal mentioned in #6 that he did indeed run into issues with the optional loading of fs-extra.

kevinbeaty commented 8 years ago

Closed by #8