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() #95

Closed
aduh95 opened this issue Apr 23, 2020 · 1 comment · Fixed by #96
Closed

Stop using process.umask() #95

aduh95 opened this issue Apr 23, 2020 · 1 comment · Fixed by #96

Comments

@aduh95
Copy link
Contributor

aduh95 commented Apr 23, 2020

Refs: nodejs/node#32321

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

I couldn't quite divine what this lib uses process.umask() for but in most cases you don't need to deal with the umask directly - the operating system will apply it automatically.

Example:

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

Computing the file mode that way is superfluous, it can be replaced with just this:

fs.mkdirSync(dir, 0o777);
aduh95 added a commit to aduh95/extract-zip that referenced this issue Apr 23, 2020
aduh95 added a commit to aduh95/extract-zip that referenced this issue Apr 23, 2020
@malept
Copy link
Collaborator

malept commented Jun 9, 2020

🤷‍♂️ This is the commit that introduced it: 6ad307a

malept pushed a commit that referenced this issue Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants