-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Feature request: provide deep (recursive) fs.writeFile() #37733
Comments
Can't you use |
@cjihrig yep, you can - that's what I was referring to. I've written that boilerplate often and it feels relatively unnecessary if we know users will follow that pattern. |
Just here to note that "recursive" doesn't make sense in this context. (Recursively writing to a file? What would that even mean? Infinite loop into a pipe?) Something like |
I used |
I don't quite know if this is high enough quality to make it into core, or if we can even do something like using one public method inside another public method, but here's a tiny example of how it can be done with consumer code. I imagine that if we don't like consuming one public method in another, the code from https://gist.github.com/bnb/2345f18a7fd1bb16ee5d8476b9833bd3 |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment. For more information on how the project manages feature requests, please consult the feature request management document. |
This seemed like a cool request– is there any status on this? |
Is your feature request related to a problem? Please describe.
Please describe the problem you are trying to solve.
Having to write the same boilerplate for writing a file to a directory that doesn't yet exist over and over again.
Describe the solution you'd like
Please describe the desired behavior.
Ideally, I'd be able to use
fs.writeFile()
(orfs.writeFileSync()
) with the{ recursive: true }
option that's available onfs.mkdir()
and its friends.Describe alternatives you've considered
Please describe alternative solutions or features you have considered.
The text was updated successfully, but these errors were encountered: