Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comments on naming #5

Closed
coolaj86 opened this issue Jul 26, 2012 · 6 comments
Closed

comments on naming #5

coolaj86 opened this issue Jul 26, 2012 · 6 comments

Comments

@coolaj86
Copy link

  • mkdir - I believe that fs-extra.mkdir should not have different behavior than fs.mkdir.
@jprichardson
Copy link
Owner

Is that because it's confusing? I mean, wouldn't you think that most people would want to make the directory regardless of whether its parent directories existed? Do you have thoughts on an alternative name?

@coolaj86
Copy link
Author

I agree with you that it's a common use case, but I also worry about the confusion. fs.mkdir already has a defined api and could possibly cause problems that are difficult to debug for someone working in code that they didn't write where they see fs.mkdir and don't notice fs = require('fs-extra').

  • fs.mkdirp (all unix-y)
  • fs.mkdirs (all English-y)

I do like how you create your own object for fs rather than just appending to the global fs. I've changed my module to behave that way now as well.

@jprichardson
Copy link
Owner

Hmm, you have a good point. But, I still fail to see why you wouldn't want the behavior of mkdir -p when your run mkdir... I'll still have to think on this one.

@jprichardson
Copy link
Owner

OK, I've come to the conclusion that I agree based upon more thought and this feedback as well: #9 I'll be posting a change soon.

@jprichardson
Copy link
Owner

OK, note to all: @superjoe30 @chrisabrams @Trimeego @MUSCULA @LarryEitel @peteromano @dilvie @cpsubrian @filmic @thisandagain
@volcanicpixels @kainosnoema @SpotterRF @vistarmedia

fs.mkdir is now fs.mkdirp or fs.mkdirs. fs.mkdir is now the expected native Node.js mkdir function.

If you're wondering why your name is tagged, it's because you've published a package to NPM that depends upon fs-extra and I wanted you to be aware of this breaking change. Note, that if your package.json requirements is set correctly to 0.2.x or ~0.2.1 then you don't need to worry about this as it only affects versions >= 0.3.

@ericelliott
Copy link

Thanks for the notification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants