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

[RFC]: add fs/mkdir #2116

Open
3 tasks done
Daniel777y opened this issue Apr 3, 2024 · 5 comments · May be fixed by #2198
Open
3 tasks done

[RFC]: add fs/mkdir #2116

Daniel777y opened this issue Apr 3, 2024 · 5 comments · May be fixed by #2198
Assignees
Labels
Accepted RFC feature request which has been accepted. difficulty: 3 Likely to be challenging but manageable. Feature Issue or pull request for adding a new feature. JavaScript Issue involves or relates to JavaScript. priority: Normal Normal priority concern or feature request. RFC Request for comments. Feature requests and proposed changes. Utilities Issue or pull request concerning general utilities.

Comments

@Daniel777y
Copy link
Contributor

Daniel777y commented Apr 3, 2024

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

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@Daniel777y
Copy link
Contributor Author

Hi @kgryte , can I work on this?

@stdlib-bot
Copy link
Contributor

👋 Hi there! 👋

And thank you for opening your first issue! We will get back to you shortly. 🏃 💨

@kgryte
Copy link
Member

kgryte commented Apr 4, 2024

@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.

@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. Feature Issue or pull request for adding a new feature. difficulty: 3 Likely to be challenging but manageable. Utilities Issue or pull request concerning general utilities. Accepted RFC feature request which has been accepted. priority: Normal Normal priority concern or feature request. JavaScript Issue involves or relates to JavaScript. labels Apr 4, 2024
@Daniel777y
Copy link
Contributor Author

@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.

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.

@kgryte
Copy link
Member

kgryte commented Apr 11, 2024

Yes, I think that makes sense.

@Daniel777y Daniel777y linked a pull request Apr 22, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted RFC feature request which has been accepted. difficulty: 3 Likely to be challenging but manageable. Feature Issue or pull request for adding a new feature. JavaScript Issue involves or relates to JavaScript. priority: Normal Normal priority concern or feature request. RFC Request for comments. Feature requests and proposed changes. Utilities Issue or pull request concerning general utilities.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants