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

Do not depend on deprecated 'constants' module #206

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kt3k
Copy link

@kt3k kt3k commented Feb 21, 2021

constants module has been deprecated since v6.3.0 (ref: https://nodejs.org/api/deprecations.html#DEP0008 ). This PR updates the use of constants to fs.constants.

BTW fs.constants doesn't inherit from Object.prototype (ref: nodejs/node#10458 ), so I updated constants.hasOwnProperty('O_SYMLINK') to constants.O_SYMLINK !== undefined. (This change was discussed in node.js repository nodejs/node#10458 (comment) )

@kt3k kt3k force-pushed the fix/do-not-depend-on-deprecated-constants branch from 9f7b7c4 to 45e62bd Compare February 21, 2021 13:01
polyfills.js Outdated Show resolved Hide resolved
Copy link

@aminya aminya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing a lot of issues for me. @isaacs Please take a look

@aminya
Copy link

aminya commented Jul 23, 2021

fs-extra is broken and cannot be bundled because of this.

@anthonyborell
Copy link

@isaacs Would be great if you could take a look at this. As per https://nodejs.org/api/deprecations.html#DEP0008

The constants module is deprecated. When requiring access to constants relevant to specific Node.js builtin modules, developers should instead refer to the constants property exposed by the relevant module. For instance, require('fs').constants and require('os').constants.

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 this pull request may close these issues.

4 participants