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

Stop using process.umask() #27

Closed
bnoordhuis opened this issue Apr 3, 2020 · 0 comments · Fixed by #28
Closed

Stop using process.umask() #27

bnoordhuis opened this issue Apr 3, 2020 · 0 comments · Fixed by #28

Comments

@bnoordhuis
Copy link

Refs: nodejs/node#32321

Summary: process.umask() (no args) will be deprecated and removed.

Reviewing this module, it uses process.umask() in roughly this pattern:

const mode = 0o777 & ~process.umask();
fs.mkdirSync(dir, mode);

Computing the file mode that way is superfluous because the operating system applies the umask anyway. It can be replaced with just this:

fs.mkdirSync(dir, 0o777);
coreyfarrell added a commit to coreyfarrell/make-dir that referenced this issue Apr 22, 2020
coreyfarrell added a commit to coreyfarrell/make-dir that referenced this issue Apr 22, 2020
sindresorhus pushed a commit that referenced this issue Apr 22, 2020
RyanZim added a commit to jprichardson/node-fs-extra that referenced this issue Apr 23, 2020
RyanZim added a commit to jprichardson/node-fs-extra that referenced this issue Apr 24, 2020
* Don't use deprecated process.umask()

Refs sindresorhus/make-dir#27

* Remove unneeded umask tests

No need to test Node.js core's behavior (which is all these tests do)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants