GeezerVison is showing github.com — fs: fs.mkdirs or fs.mkdirp · Issue #683 · nodejs/node
fs: fs.mkdirs or fs.mkdirp #683Labels fsIssues and PRs related to file-system APIs and the fs module. DescriptionI hope fs module can provide a method likes mkdirp.
Yes, mkdirp module is good, and much people use it or depend on it.
But, I think it should be provided at language level not library level.
Just like Java:
// Creates the directory named by this abstract pathname.
public boolean mkdir()
//Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories.
public boolean mkdirs() Activitycjihrig commented on Jan 31, 2015 Is there any reason this needs to be a part of core? Feature parity with Java is definitely not a reason :-) vkurchatkin commented on Jan 31, 2015 Qard commented on Jan 31, 2015 Personally, I find it a bit weird that a recursive option exists in the command line tool but not in the node.js/io.js interface. As explained in the node issue though, it has to do with the posix interface not having a recursive component to it.
It's easy enough to just depend on mkdirp though. At best, I'd say this is very low priority. jonathanong commented on Jan 31, 2015 i think it's only worth adding if it's done in the C++ layer with some sort of performance improvement. if it's written in JS, then it might as well remain a module. rvagg commented on Jan 31, 2015 What reasons would you need mkdirp to be optimised? Are you making nested directories for each web request or something?
I'm not convinced, mkdirp exists and is well used & liked. So -1 from me. othiym23 commented on Jan 31, 2015 -1 from me as well. mkdirp is an npm install away, and even includes a command-line utility for Windows users. ifraixedes commented on Jan 31, 2015 I agree with @jonathanong however @rvagg is in the point, what use case should need that level of optimization? if no use case the optimization, if there is any, shouldn't be needed, then -1, too. Fishrock123 commented on Jan 31, 2015 I've always found it rather strange that recursive mkdir* isn't default. -0 added fsIssues and PRs related to file-system APIs and the fs module. on Feb 1, 2015xionglun commented on Feb 1, 2015
-
Too many people use it
just look at mkdirp's stats:
132,488 downloads in the last day
1,754,521 downloads in the last week
6,734,370 downloads in the last month
-
It could be a fundamental method bind to core object---fs
It will be more natural than use a plugin or an extension like mkdirp. It's not a performance issue but seems should be part of fs.
-
Not need install every time
As mentioned at the top, so many people rely on it. Every time i use it, have to use npm install.
Yes, npm install works, but not always works. such as at bad networking or behind our GFW.
rvagg commented on Feb 1, 2015 Welcome to Node, where our standard library is tiny and all of the good stuff is in npm.
Many of us will fight hard to keep it that way.
There's already a mirror behind the GFW, you should probably use that, see http://cnpmjs.org/ xionglun commented on Feb 1, 2015 @rvagg Yes, I appreciate that principle.
But, honestly, if fs.mkdirs exists, I bet it will be more popular than other fs methods such as fs.chown, fs.chmod.
If you insist, well, that's ok. Delapouite commented on Feb 1, 2015
MetadataMetadatafsIssues and PRs related to file-system APIs and the fs module. DevelopmentNo branches or pull requestsIssue actions
|