[RFC]: add `fs/mkdir`
Description
This RFC proposes adding the package @stdlib/fs/mkdir for creating a directory asynchronously and synchronously.
Package: @stdlib/fs/mkdir
var mkdir = require( '@stdlib/fs/mkdir' );
var mkdirSync = require( '@stdlib/fs/mkdir' ).sync;
Related Issues
None.
Questions
No.
Other
No.
Checklist
- [X] I have read and understood the Code of Conduct.
- [X] Searched for existing issues and pull requests.
- [X] The issue name begins with
RFC:.
Hi @kgryte , can I work on this?
:wave: Hi there! :wave:
And thank you for opening your first issue! We will get back to you shortly. :runner: :dash:
@Daniel777y Yes, this would be useful. Note, however, that you'll want to accommodate older Node.js environments not supporting the options object (and hence recursive). You can consult https://github.com/isaacs/node-mkdirp, but note that the default API for that package is now promise-based. You'll want to provide only a callback async API for fs/mkdir. Older versions of node-mkdirp were callback-based, but newer versions may have resolved some bugs. In short, you'll need to do some R&D to provide a polyfill for older Node.js versions.
@Daniel777y Yes, this would be useful. Note, however, that you'll want to accommodate older Node.js environments not supporting the
optionsobject (and hencerecursive). You can consult https://github.com/isaacs/node-mkdirp, but note that the default API for that package is now promise-based. You'll want to provide only a callback async API forfs/mkdir. Older versions ofnode-mkdirpwere callback-based, but newer versions may have resolved some bugs. In short, you'll need to do some R&D to provide a polyfill for older Node.js versions.
Hi, @kgryte , just to clarity, I only need to align with the latest usage but to accommodate older Node.js environments, right? For example, callback was optional in older versions, but not passing it will still throw an error in stdlib. Correct me if I am wrong.
Yes, I think that makes sense.